aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 13:52:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 13:52:35 -0500
commit525995d77ca08dfc2ba6f8e606f93694271dbd66 (patch)
treebe9ddad66cd1301eea8dab7814cbda144a909e35 /Documentation
parente4bdda1bc3123a9e65f4dd93a23041fde8ed3dc2 (diff)
parent64a2b168023bfd09037ba760838762e56c44178e (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin: (88 commits) Blackfin: Convert BUG() to use unreachable() Blackfin: define __NR_recvmmsg Blackfin: drop duplicate sched_clock Blackfin: NOMPU: skip DMA ICPLB hole when it is redundant Blackfin: MPU: add missing __init markings Blackfin: add support for TIF_NOTIFY_RESUME Blackfin: kgdb_test: clean up code a bit Blackfin: convert kgdbtest to proc_fops Blackfin: convert cyc2ns() to clocksource_cyc2ns() Blackfin: ip0x: pull in asm/portmux.h for P_xxx defines Blackfin: drop unused ax88180 resources Blackfin: bf537-stamp: add ADF702x network driver resources Blackfin: bf537-stamp: add CAN resources Blackfin: bf537-stamp: add AD5258 i2c address Blackfin: bf537-stamp: add adau1761 i2c address Blackfin: bf537-stamp: add adau1371 i2c address Blackfin: bf537-stamp: add ADP8870 resources Blackfin: bf537-stamp: kill AD714x board-specific Kconfigs Blackfin: bf537-stamp: update ADP5520 resources Blackfin: bf537-stamp: add ADXL346 orientation sensing support ...
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/blackfin/00-INDEX3
-rw-r--r--Documentation/blackfin/Makefile6
-rw-r--r--Documentation/blackfin/cache-lock.txt48
-rw-r--r--Documentation/blackfin/cachefeatures.txt10
-rw-r--r--Documentation/blackfin/gptimers-example.c83
5 files changed, 89 insertions, 61 deletions
diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-INDEX
index d6840a91e1e1..c34e12440fec 100644
--- a/Documentation/blackfin/00-INDEX
+++ b/Documentation/blackfin/00-INDEX
@@ -1,9 +1,6 @@
100-INDEX 100-INDEX
2 - This file 2 - This file
3 3
4cache-lock.txt
5 - HOWTO for blackfin cache locking.
6
7cachefeatures.txt 4cachefeatures.txt
8 - Supported cache features. 5 - Supported cache features.
9 6
diff --git a/Documentation/blackfin/Makefile b/Documentation/blackfin/Makefile
new file mode 100644
index 000000000000..773dbb103f1c
--- /dev/null
+++ b/Documentation/blackfin/Makefile
@@ -0,0 +1,6 @@
1obj-m := gptimers-example.o
2
3all: modules
4
5modules clean:
6 $(MAKE) -C ../.. SUBDIRS=$(PWD) $@
diff --git a/Documentation/blackfin/cache-lock.txt b/Documentation/blackfin/cache-lock.txt
deleted file mode 100644
index 88ba1e6c31c3..000000000000
--- a/Documentation/blackfin/cache-lock.txt
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * File: Documentation/blackfin/cache-lock.txt
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: This file contains the simple DMA Implementation for Blackfin
8 *
9 * Rev: $Id: cache-lock.txt 2384 2006-11-01 04:12:43Z magicyang $
10 *
11 * Modified:
12 * Copyright 2004-2006 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 */
17
18How to lock your code in cache in uClinux/blackfin
19--------------------------------------------------
20
21There are only a few steps required to lock your code into the cache.
22Currently you can lock the code by Way.
23
24Below are the interface provided for locking the cache.
25
26
271. cache_grab_lock(int Ways);
28
29This function grab the lock for locking your code into the cache specified
30by Ways.
31
32
332. cache_lock(int Ways);
34
35This function should be called after your critical code has been executed.
36Once the critical code exits, the code is now loaded into the cache. This
37function locks the code into the cache.
38
39
40So, the example sequence will be:
41
42 cache_grab_lock(WAY0_L); /* Grab the lock */
43
44 critical_code(); /* Execute the code of interest */
45
46 cache_lock(WAY0_L); /* Lock the cache */
47
48Where WAY0_L signifies WAY0 locking.
diff --git a/Documentation/blackfin/cachefeatures.txt b/Documentation/blackfin/cachefeatures.txt
index 0fbec23becb5..75de51f94515 100644
--- a/Documentation/blackfin/cachefeatures.txt
+++ b/Documentation/blackfin/cachefeatures.txt
@@ -41,16 +41,6 @@
41 icplb_flush(); 41 icplb_flush();
42 dcplb_flush(); 42 dcplb_flush();
43 43
44 - Locking the cache.
45
46 cache_grab_lock();
47 cache_lock();
48
49 Please refer linux-2.6.x/Documentation/blackfin/cache-lock.txt for how to
50 lock the cache.
51
52 Locking the cache is optional feature.
53
54 - Miscellaneous cache functions. 44 - Miscellaneous cache functions.
55 45
56 flush_cache_all(); 46 flush_cache_all();
diff --git a/Documentation/blackfin/gptimers-example.c b/Documentation/blackfin/gptimers-example.c
new file mode 100644
index 000000000000..b1bd6340e748
--- /dev/null
+++ b/Documentation/blackfin/gptimers-example.c
@@ -0,0 +1,83 @@
1/*
2 * Simple gptimers example
3 * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gptimers
4 *
5 * Copyright 2007-2009 Analog Devices Inc.
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#include <linux/interrupt.h>
11#include <linux/module.h>
12
13#include <asm/gptimers.h>
14#include <asm/portmux.h>
15
16/* ... random driver includes ... */
17
18#define DRIVER_NAME "gptimer_example"
19
20struct gptimer_data {
21 uint32_t period, width;
22};
23static struct gptimer_data data;
24
25/* ... random driver state ... */
26
27static irqreturn_t gptimer_example_irq(int irq, void *dev_id)
28{
29 struct gptimer_data *data = dev_id;
30
31 /* make sure it was our timer which caused the interrupt */
32 if (!get_gptimer_intr(TIMER5_id))
33 return IRQ_NONE;
34
35 /* read the width/period values that were captured for the waveform */
36 data->width = get_gptimer_pwidth(TIMER5_id);
37 data->period = get_gptimer_period(TIMER5_id);
38
39 /* acknowledge the interrupt */
40 clear_gptimer_intr(TIMER5_id);
41
42 /* tell the upper layers we took care of things */
43 return IRQ_HANDLED;
44}
45
46/* ... random driver code ... */
47
48static int __init gptimer_example_init(void)
49{
50 int ret;
51
52 /* grab the peripheral pins */
53 ret = peripheral_request(P_TMR5, DRIVER_NAME);
54 if (ret) {
55 printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n");
56 return ret;
57 }
58
59 /* grab the IRQ for the timer */
60 ret = request_irq(IRQ_TIMER5, gptimer_example_irq, IRQF_SHARED, DRIVER_NAME, &data);
61 if (ret) {
62 printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
63 peripheral_free(P_TMR5);
64 return ret;
65 }
66
67 /* setup the timer and enable it */
68 set_gptimer_config(TIMER5_id, WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA);
69 enable_gptimers(TIMER5bit);
70
71 return 0;
72}
73module_init(gptimer_example_init);
74
75static void __exit gptimer_example_exit(void)
76{
77 disable_gptimers(TIMER5bit);
78 free_irq(IRQ_TIMER5, &data);
79 peripheral_free(P_TMR5);
80}
81module_exit(gptimer_example_exit);
82
83MODULE_LICENSE("BSD");