diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/blackfin/00-INDEX | 3 | ||||
-rw-r--r-- | Documentation/blackfin/Makefile | 6 | ||||
-rw-r--r-- | Documentation/blackfin/cache-lock.txt | 48 | ||||
-rw-r--r-- | Documentation/blackfin/cachefeatures.txt | 10 | ||||
-rw-r--r-- | Documentation/blackfin/gptimers-example.c | 83 |
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 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - This file | 2 | - This file |
3 | 3 | ||
4 | cache-lock.txt | ||
5 | - HOWTO for blackfin cache locking. | ||
6 | |||
7 | cachefeatures.txt | 4 | cachefeatures.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 @@ | |||
1 | obj-m := gptimers-example.o | ||
2 | |||
3 | all: modules | ||
4 | |||
5 | modules 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 | |||
18 | How to lock your code in cache in uClinux/blackfin | ||
19 | -------------------------------------------------- | ||
20 | |||
21 | There are only a few steps required to lock your code into the cache. | ||
22 | Currently you can lock the code by Way. | ||
23 | |||
24 | Below are the interface provided for locking the cache. | ||
25 | |||
26 | |||
27 | 1. cache_grab_lock(int Ways); | ||
28 | |||
29 | This function grab the lock for locking your code into the cache specified | ||
30 | by Ways. | ||
31 | |||
32 | |||
33 | 2. cache_lock(int Ways); | ||
34 | |||
35 | This function should be called after your critical code has been executed. | ||
36 | Once the critical code exits, the code is now loaded into the cache. This | ||
37 | function locks the code into the cache. | ||
38 | |||
39 | |||
40 | So, 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 | |||
48 | Where 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 | |||
20 | struct gptimer_data { | ||
21 | uint32_t period, width; | ||
22 | }; | ||
23 | static struct gptimer_data data; | ||
24 | |||
25 | /* ... random driver state ... */ | ||
26 | |||
27 | static 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 | |||
48 | static 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 | } | ||
73 | module_init(gptimer_example_init); | ||
74 | |||
75 | static void __exit gptimer_example_exit(void) | ||
76 | { | ||
77 | disable_gptimers(TIMER5bit); | ||
78 | free_irq(IRQ_TIMER5, &data); | ||
79 | peripheral_free(P_TMR5); | ||
80 | } | ||
81 | module_exit(gptimer_example_exit); | ||
82 | |||
83 | MODULE_LICENSE("BSD"); | ||