Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple VME FMC Carrier SVEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple VME FMC Carrier SVEC - Software
Commits
d72e253e
Commit
d72e253e
authored
Jul 19, 2016
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel:[plat] fix sub-devices removal order (just before re-programming)
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
dcd9ca5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
19 deletions
+23
-19
svec-drv.c
kernel/svec-drv.c
+11
-0
svec-fmc.c
kernel/svec-fmc.c
+12
-19
No files found.
kernel/svec-drv.c
View file @
d72e253e
...
...
@@ -16,6 +16,7 @@
#include <linux/firmware.h>
#include <linux/delay.h>
#include <linux/jhash.h>
#include <linux/platform_device.h>
#include <linux/fmc-sdb.h>
#include "svec.h"
#include "hw/xloader_regs.h"
...
...
@@ -383,6 +384,16 @@ static int svec_remove(struct device *pdev, unsigned int ndev)
{
struct
svec_dev
*
svec
=
dev_get_drvdata
(
pdev
);
/* The MockTurtle use the VIC so remove it before */
if
(
svec
->
pdev_trtl
)
{
platform_device_unregister
(
svec
->
pdev_trtl
);
svec
->
pdev_trtl
=
NULL
;
}
if
(
svec
->
pdev_vic
)
{
platform_device_unregister
(
svec
->
pdev_vic
);
svec
->
pdev_vic
=
NULL
;
}
if
(
test_bit
(
SVEC_FLAG_FMCS_REGISTERED
,
&
svec
->
flags
))
{
svec_fmc_destroy
(
svec
);
clear_bit
(
SVEC_FLAG_FMCS_REGISTERED
,
&
svec
->
flags
);
...
...
kernel/svec-fmc.c
View file @
d72e253e
...
...
@@ -57,6 +57,17 @@ static int svec_reprogram_raw(struct fmc_device *fmc, struct fmc_driver *drv,
if
(
!
drv
)
dev_info
(
dev
,
"Carrier FPGA re-program
\n
"
);
/* Destroy old components */
/* Remove trtl before vic. MockTurtle use the VIC */
if
(
svec
->
pdev_trtl
)
{
platform_device_unregister
(
svec
->
pdev_trtl
);
svec
->
pdev_trtl
=
NULL
;
}
if
(
svec
->
pdev_vic
)
{
platform_device_unregister
(
svec
->
pdev_vic
);
svec
->
pdev_vic
=
NULL
;
}
fmc_free_sdb_tree
(
fmc
);
fmc
->
flags
&=
~
FMC_DEVICE_HAS_GOLDEN
;
...
...
@@ -74,6 +85,7 @@ static int svec_reprogram_raw(struct fmc_device *fmc, struct fmc_driver *drv,
fmc
->
flags
|=
FMC_DEVICE_HAS_CUSTOM
;
svec_scan_cores
(
svec
);
return
0
;
}
...
...
@@ -83,16 +95,6 @@ static struct resource htvic_resource[] = {
};
static
void
svec_destroy_platform
(
struct
platform_device
*
pdev
)
{
if
(
!
pdev
)
return
;
platform_device_unregister
(
pdev
);
pdev
=
NULL
;
}
static
int
svec_create_vic
(
struct
svec_dev
*
svec
)
{
struct
vme_dev
*
vme_dev
=
to_vme_dev
(
svec
->
dev
);
...
...
@@ -210,11 +212,6 @@ static int svec_create_trtl(struct svec_dev *svec)
static
int
svec_scan_cores
(
struct
svec_dev
*
svec
)
{
/* Destroy old components */
/* Remove trtl before vic. MockTurtle use the VIC */
svec_destroy_platform
(
svec
->
pdev_trtl
);
svec_destroy_platform
(
svec
->
pdev_vic
);
svec_create_vic
(
svec
);
svec_create_trtl
(
svec
);
...
...
@@ -460,10 +457,6 @@ failed:
void
svec_fmc_destroy
(
struct
svec_dev
*
svec
)
{
/* The MockTurtle use the VIC so remove it before */
svec_destroy_platform
(
svec
->
pdev_trtl
);
svec_destroy_platform
(
svec
->
pdev_vic
);
if
(
!
svec
->
fmcs
[
0
])
return
;
...
...
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