Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 525995d7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* '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
  ...
parents e4bdda1b 64a2b168
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
00-INDEX
	- This file

cache-lock.txt
	- HOWTO for blackfin cache locking.

cachefeatures.txt
	- Supported cache features.

+6 −0
Original line number Diff line number Diff line
obj-m := gptimers-example.o

all: modules

modules clean:
	$(MAKE) -C ../.. SUBDIRS=$(PWD) $@
+0 −48
Original line number Diff line number Diff line
/*
 * File:         Documentation/blackfin/cache-lock.txt
 * Based on:
 * Author:
 *
 * Created:
 * Description:  This file contains the simple DMA Implementation for Blackfin
 *
 * Rev:          $Id: cache-lock.txt 2384 2006-11-01 04:12:43Z magicyang $
 *
 * Modified:
 *               Copyright 2004-2006 Analog Devices Inc.
 *
 * Bugs:         Enter bugs at http://blackfin.uclinux.org/
 *
 */

How to lock your code in cache in uClinux/blackfin
--------------------------------------------------

There are only a few steps required to lock your code into the cache.
Currently you can lock the code by Way.

Below are the interface provided for locking the cache.


1. cache_grab_lock(int Ways);

This function grab the lock for locking your code into the cache specified
by Ways.


2. cache_lock(int Ways);

This function should be called after your critical code has been executed.
Once the critical code exits, the code is now loaded into the cache. This
function locks the code into the cache.


So, the example sequence will be:

	cache_grab_lock(WAY0_L);	/* Grab the lock */

	critical_code();		/* Execute the code of interest */

	cache_lock(WAY0_L);		/* Lock the cache */

Where WAY0_L signifies WAY0 locking.
+0 −10
Original line number Diff line number Diff line
@@ -41,16 +41,6 @@
		icplb_flush();
		dcplb_flush();

	- Locking the cache.

		cache_grab_lock();
		cache_lock();

	Please refer linux-2.6.x/Documentation/blackfin/cache-lock.txt for how to
	lock the cache.

	Locking the cache is optional feature.

	- Miscellaneous cache functions.

		flush_cache_all();
+83 −0
Original line number Diff line number Diff line
/*
 * Simple gptimers example
 *	http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gptimers
 *
 * Copyright 2007-2009 Analog Devices Inc.
 *
 * Licensed under the GPL-2 or later.
 */

#include <linux/interrupt.h>
#include <linux/module.h>

#include <asm/gptimers.h>
#include <asm/portmux.h>

/* ... random driver includes ... */

#define DRIVER_NAME "gptimer_example"

struct gptimer_data {
	uint32_t period, width;
};
static struct gptimer_data data;

/* ... random driver state ... */

static irqreturn_t gptimer_example_irq(int irq, void *dev_id)
{
	struct gptimer_data *data = dev_id;

	/* make sure it was our timer which caused the interrupt */
	if (!get_gptimer_intr(TIMER5_id))
		return IRQ_NONE;

	/* read the width/period values that were captured for the waveform */
	data->width = get_gptimer_pwidth(TIMER5_id);
	data->period = get_gptimer_period(TIMER5_id);

	/* acknowledge the interrupt */
	clear_gptimer_intr(TIMER5_id);

	/* tell the upper layers we took care of things */
	return IRQ_HANDLED;
}

/* ... random driver code ... */

static int __init gptimer_example_init(void)
{
	int ret;

	/* grab the peripheral pins */
	ret = peripheral_request(P_TMR5, DRIVER_NAME);
	if (ret) {
		printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n");
		return ret;
	}

	/* grab the IRQ for the timer */
	ret = request_irq(IRQ_TIMER5, gptimer_example_irq, IRQF_SHARED, DRIVER_NAME, &data);
	if (ret) {
		printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
		peripheral_free(P_TMR5);
		return ret;
	}

	/* setup the timer and enable it */
	set_gptimer_config(TIMER5_id, WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA);
	enable_gptimers(TIMER5bit);

	return 0;
}
module_init(gptimer_example_init);

static void __exit gptimer_example_exit(void)
{
	disable_gptimers(TIMER5bit);
	free_irq(IRQ_TIMER5, &data);
	peripheral_free(P_TMR5);
}
module_exit(gptimer_example_exit);

MODULE_LICENSE("BSD");
Loading