summaryrefslogtreecommitdiff
path: root/drivers/dsp/syslink/notify_dispatcher/hw_ocp.c
blob: 350fdf04cf2c746b2646f8058578217f2fbc98f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * hw_ocp.c
 *
 * Syslink dispatcher driver support for OMAP Processors.
 *
 *  Copyright (C) 2008-2009 Texas Instruments, Inc.
 *
 *  This package is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 *  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 *  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 *  PURPOSE.
 */

#include <syslink/GlobalTypes.h>
#include <syslink/hw_ocp.h>
#include <syslink/hw_defs.h>
#include <syslink/MBXRegAcM.h>
#include <syslink/MBXAccInt.h>
#include <linux/module.h>


long hw_ocp_soft_reset(const unsigned long base_address)
{
	long status = RET_OK;
	MLBMAILBOX_SYSCONFIGSoftResetWrite32(base_address, HW_SET);
	return status;
}

long hw_ocp_soft_reset_isdone(const unsigned long base_address,
					unsigned long *reset_is_done)
{
	long status = RET_OK;

	*reset_is_done = MLBMAILBOX_SYSSTATUSResetDoneRead32(base_address);

	return status;
}

long hw_ocp_idle_modeset(const unsigned long base_address,
			enum hal_ocp_idlemode_t idle_mode)
{
	long status = RET_OK;

	MLBMAILBOX_SYSCONFIGSIdleModeWrite32(base_address, idle_mode);

	return status;
}


long hw_ocp_idlemode_get(const unsigned long base_address,
			enum hal_ocp_idlemode_t *idle_mode)
{
	long status = RET_OK;

	*idle_mode = (enum hal_ocp_idlemode_t)
			MLBMAILBOX_SYSCONFIGSIdleModeRead32(base_address);

	return status;
}

long hw_ocp_autoidle_set(const unsigned long base_address,
				enum hw_set_clear_t auto_idle)
{
	long status = RET_OK;

	MLBMAILBOX_SYSCONFIGAutoIdleWrite32(base_address, auto_idle);

	return status;
}

long hw_ocp_autoidle_get(const unsigned long base_address,
				enum hw_set_clear_t *auto_idle)
{
	long status = RET_OK;

	*auto_idle = (enum hw_set_clear_t)
			MLBMAILBOX_SYSCONFIGAutoIdleRead32(base_address);

	return status;
}