Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
ac8a1eb0
Commit
ac8a1eb0
authored
Oct 19, 2017
by
Thierry Reding
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-4.15/firmware' into for-4.15/thermal
parents
5f5f4e1b
80d47a91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
11 deletions
+61
-11
drivers/firmware/tegra/bpmp.c
drivers/firmware/tegra/bpmp.c
+19
-8
include/soc/tegra/bpmp.h
include/soc/tegra/bpmp.h
+42
-3
No files found.
drivers/firmware/tegra/bpmp.c
View file @
ac8a1eb0
...
...
@@ -194,16 +194,24 @@ static int tegra_bpmp_wait_master_free(struct tegra_bpmp_channel *channel)
}
static
ssize_t
__tegra_bpmp_channel_read
(
struct
tegra_bpmp_channel
*
channel
,
void
*
data
,
size_t
size
)
void
*
data
,
size_t
size
,
int
*
ret
)
{
int
err
;
if
(
data
&&
size
>
0
)
memcpy
(
data
,
channel
->
ib
->
data
,
size
);
return
tegra_ivc_read_advance
(
channel
->
ivc
);
err
=
tegra_ivc_read_advance
(
channel
->
ivc
);
if
(
err
<
0
)
return
err
;
*
ret
=
channel
->
ib
->
code
;
return
0
;
}
static
ssize_t
tegra_bpmp_channel_read
(
struct
tegra_bpmp_channel
*
channel
,
void
*
data
,
size_t
size
)
void
*
data
,
size_t
size
,
int
*
ret
)
{
struct
tegra_bpmp
*
bpmp
=
channel
->
bpmp
;
unsigned
long
flags
;
...
...
@@ -217,7 +225,7 @@ static ssize_t tegra_bpmp_channel_read(struct tegra_bpmp_channel *channel,
}
spin_lock_irqsave
(
&
bpmp
->
lock
,
flags
);
err
=
__tegra_bpmp_channel_read
(
channel
,
data
,
size
);
err
=
__tegra_bpmp_channel_read
(
channel
,
data
,
size
,
ret
);
clear_bit
(
index
,
bpmp
->
threaded
.
allocated
);
spin_unlock_irqrestore
(
&
bpmp
->
lock
,
flags
);
...
...
@@ -337,7 +345,8 @@ int tegra_bpmp_transfer_atomic(struct tegra_bpmp *bpmp,
if
(
err
<
0
)
return
err
;
return
__tegra_bpmp_channel_read
(
channel
,
msg
->
rx
.
data
,
msg
->
rx
.
size
);
return
__tegra_bpmp_channel_read
(
channel
,
msg
->
rx
.
data
,
msg
->
rx
.
size
,
&
msg
->
rx
.
ret
);
}
EXPORT_SYMBOL_GPL
(
tegra_bpmp_transfer_atomic
);
...
...
@@ -371,7 +380,8 @@ int tegra_bpmp_transfer(struct tegra_bpmp *bpmp,
if
(
err
==
0
)
return
-
ETIMEDOUT
;
return
tegra_bpmp_channel_read
(
channel
,
msg
->
rx
.
data
,
msg
->
rx
.
size
);
return
tegra_bpmp_channel_read
(
channel
,
msg
->
rx
.
data
,
msg
->
rx
.
size
,
&
msg
->
rx
.
ret
);
}
EXPORT_SYMBOL_GPL
(
tegra_bpmp_transfer
);
...
...
@@ -387,8 +397,8 @@ static struct tegra_bpmp_mrq *tegra_bpmp_find_mrq(struct tegra_bpmp *bpmp,
return
NULL
;
}
static
void
tegra_bpmp_mrq_return
(
struct
tegra_bpmp_channel
*
channel
,
int
code
,
const
void
*
data
,
size_t
size
)
void
tegra_bpmp_mrq_return
(
struct
tegra_bpmp_channel
*
channel
,
int
code
,
const
void
*
data
,
size_t
size
)
{
unsigned
long
flags
=
channel
->
ib
->
flags
;
struct
tegra_bpmp
*
bpmp
=
channel
->
bpmp
;
...
...
@@ -426,6 +436,7 @@ static void tegra_bpmp_mrq_return(struct tegra_bpmp_channel *channel,
mbox_client_txdone
(
bpmp
->
mbox
.
channel
,
0
);
}
}
EXPORT_SYMBOL_GPL
(
tegra_bpmp_mrq_return
);
static
void
tegra_bpmp_handle_mrq
(
struct
tegra_bpmp
*
bpmp
,
unsigned
int
mrq
,
...
...
include/soc/tegra/bpmp.h
View file @
ac8a1eb0
...
...
@@ -96,9 +96,6 @@ struct tegra_bpmp {
struct
genpd_onecell_data
genpd
;
};
struct
tegra_bpmp
*
tegra_bpmp_get
(
struct
device
*
dev
);
void
tegra_bpmp_put
(
struct
tegra_bpmp
*
bpmp
);
struct
tegra_bpmp_message
{
unsigned
int
mrq
;
...
...
@@ -110,18 +107,60 @@ struct tegra_bpmp_message {
struct
{
void
*
data
;
size_t
size
;
int
ret
;
}
rx
;
};
#if IS_ENABLED(CONFIG_TEGRA_BPMP)
struct
tegra_bpmp
*
tegra_bpmp_get
(
struct
device
*
dev
);
void
tegra_bpmp_put
(
struct
tegra_bpmp
*
bpmp
);
int
tegra_bpmp_transfer_atomic
(
struct
tegra_bpmp
*
bpmp
,
struct
tegra_bpmp_message
*
msg
);
int
tegra_bpmp_transfer
(
struct
tegra_bpmp
*
bpmp
,
struct
tegra_bpmp_message
*
msg
);
void
tegra_bpmp_mrq_return
(
struct
tegra_bpmp_channel
*
channel
,
int
code
,
const
void
*
data
,
size_t
size
);
int
tegra_bpmp_request_mrq
(
struct
tegra_bpmp
*
bpmp
,
unsigned
int
mrq
,
tegra_bpmp_mrq_handler_t
handler
,
void
*
data
);
void
tegra_bpmp_free_mrq
(
struct
tegra_bpmp
*
bpmp
,
unsigned
int
mrq
,
void
*
data
);
#else
static
inline
struct
tegra_bpmp
*
tegra_bpmp_get
(
struct
device
*
dev
)
{
return
ERR_PTR
(
-
ENOTSUPP
);
}
static
inline
void
tegra_bpmp_put
(
struct
tegra_bpmp
*
bpmp
)
{
}
static
inline
int
tegra_bpmp_transfer_atomic
(
struct
tegra_bpmp
*
bpmp
,
struct
tegra_bpmp_message
*
msg
)
{
return
-
ENOTSUPP
;
}
static
inline
int
tegra_bpmp_transfer
(
struct
tegra_bpmp
*
bpmp
,
struct
tegra_bpmp_message
*
msg
)
{
return
-
ENOTSUPP
;
}
static
inline
void
tegra_bpmp_mrq_return
(
struct
tegra_bpmp_channel
*
channel
,
int
code
,
const
void
*
data
,
size_t
size
)
{
}
static
inline
int
tegra_bpmp_request_mrq
(
struct
tegra_bpmp
*
bpmp
,
unsigned
int
mrq
,
tegra_bpmp_mrq_handler_t
handler
,
void
*
data
)
{
return
-
ENOTSUPP
;
}
static
inline
void
tegra_bpmp_free_mrq
(
struct
tegra_bpmp
*
bpmp
,
unsigned
int
mrq
,
void
*
data
)
{
}
#endif
#if IS_ENABLED(CONFIG_CLK_TEGRA_BPMP)
int
tegra_bpmp_init_clocks
(
struct
tegra_bpmp
*
bpmp
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment