linux/drivers/hwspinlock/u8500_hsem.c

// SPDX-License-Identifier: GPL-2.0
/*
 * u8500 HWSEM driver
 *
 * Copyright (C) 2010-2011 ST-Ericsson
 *
 * Implements u8500 semaphore handling for protocol 1, no interrupts.
 *
 * Author: Mathieu Poirier <[email protected]>
 * Heavily borrowed from the work of :
 *   Simon Que <[email protected]>
 *   Hari Kanigeri <[email protected]>
 *   Ohad Ben-Cohen <[email protected]>
 */

#include <linux/module.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/hwspinlock.h>
#include <linux/platform_device.h>

#include "hwspinlock_internal.h"

/*
 * Implementation of STE's HSem protocol 1 without interrutps.
 * The only masterID we allow is '0x01' to force people to use
 * HSems for synchronisation between processors rather than processes
 * on the ARM core.
 */

#define U8500_MAX_SEMAPHORE
#define RESET_SEMAPHORE

/*
 * CPU ID for master running u8500 kernel.
 * Hswpinlocks should only be used to synchonise operations
 * between the Cortex A9 core and the other CPUs.  Hence
 * forcing the masterID to a preset value.
 */
#define HSEM_MASTER_ID

#define HSEM_REGISTER_OFFSET

#define HSEM_CTRL_REG
#define HSEM_ICRALL
#define HSEM_PROTOCOL_1

static int u8500_hsem_trylock(struct hwspinlock *lock)
{}

static void u8500_hsem_unlock(struct hwspinlock *lock)
{}

/*
 * u8500: what value is recommended here ?
 */
static void u8500_hsem_relax(struct hwspinlock *lock)
{}

static const struct hwspinlock_ops u8500_hwspinlock_ops =;

static int u8500_hsem_probe(struct platform_device *pdev)
{}

static void u8500_hsem_remove(struct platform_device *pdev)
{}

static struct platform_driver u8500_hsem_driver =;

static int __init u8500_hsem_init(void)
{}
/* board init code might need to reserve hwspinlocks for predefined purposes */
postcore_initcall(u8500_hsem_init);

static void __exit u8500_hsem_exit(void)
{}
module_exit(u8500_hsem_exit);

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_AUTHOR();