Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bpm-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
bpm
bpm-sw
Commits
fe1c40a3
Commit
fe1c40a3
authored
9 years ago
by
Lucas Russo
Browse files
Options
Downloads
Patches
Plain Diff
apps/ebpm/ebpm.c: add dynamic support for FMC130 or FMC250
Now, we can select between FMC130 or FMC250 within the config file.
parent
e38dcfc9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/apps/ebpm/ebpm.c
+57
-14
57 additions, 14 deletions
src/apps/ebpm/ebpm.c
with
57 additions
and
14 deletions
src/apps/ebpm/ebpm.c
+
57
−
14
View file @
fe1c40a3
...
...
@@ -70,8 +70,8 @@ static devio_err_e _spawn_epics_iocs (devio_t *devio, uint32_t dev_id,
static
char
*
_create_log_filename
(
char
*
log_prefix
,
uint32_t
dev_id
,
const
char
*
devio_type
,
uint32_t
smio_inst_id
);
static
devio_err_e
_spawn_platform_smios
(
devio_t
*
devio
,
devio_type_e
devio_type
,
uint32_t
smio_inst_id
);
static
devio_err_e
_spawn_be_platform_smios
(
devio_t
*
devio
);
uint32_t
smio_inst_id
,
zhashx_t
*
hints
,
uint32_t
dev_id
);
static
devio_err_e
_spawn_be_platform_smios
(
devio_t
*
devio
,
zhashx_t
*
hints
,
uint32_t
dev_id
);
static
devio_err_e
_spawn_fe_platform_smios
(
devio_t
*
devio
,
uint32_t
smio_inst_id
);
void
print_help
(
char
*
program_name
)
...
...
@@ -417,7 +417,8 @@ int main (int argc, char *argv[])
broker_endp
=
NULL
;
/* Spawn platform SMIOSs */
err
=
_spawn_platform_smios
(
devio
,
devio_type
,
fe_smio_id
);
err
=
_spawn_platform_smios
(
devio
,
devio_type
,
fe_smio_id
,
devio_hints
,
dev_id
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[ebpm] _spawn_platform_smios error!
\n
"
);
goto
err_devio
;
...
...
@@ -713,7 +714,7 @@ err_devio_log_alloc:
}
static
devio_err_e
_spawn_platform_smios
(
devio_t
*
devio
,
devio_type_e
devio_type
,
uint32_t
smio_inst_id
)
uint32_t
smio_inst_id
,
zhashx_t
*
hints
,
uint32_t
dev_id
)
{
assert
(
devio
);
...
...
@@ -721,7 +722,7 @@ static devio_err_e _spawn_platform_smios (devio_t *devio, devio_type_e devio_typ
switch
(
devio_type
)
{
case
BE_DEVIO
:
err
=
_spawn_be_platform_smios
(
devio
);
err
=
_spawn_be_platform_smios
(
devio
,
hints
,
dev_id
);
break
;
case
FE_DEVIO
:
...
...
@@ -742,9 +743,12 @@ err_register_sm:
return
err
;
}
static
devio_err_e
_spawn_be_platform_smios
(
devio_t
*
devio
)
static
devio_err_e
_spawn_be_platform_smios
(
devio_t
*
devio
,
zhashx_t
*
hints
,
uint32_t
dev_id
)
{
const
char
*
fmc_board_130m_4ch
=
"fmc130m_4ch"
;
const
char
*
fmc_board_250m_4ch
=
"fmc250m_4ch"
;
uint32_t
fmc130m_4ch_id
=
0x7085ef15
;
uint32_t
fmc250m_4ch_id
=
0x68e3b1af
;
uint32_t
acq_id
=
0x4519a0ad
;
uint32_t
dsp_id
=
0x1bafbf1e
;
uint32_t
swap_id
=
0x12897592
;
...
...
@@ -753,10 +757,31 @@ static devio_err_e _spawn_be_platform_smios (devio_t *devio)
/* ML605 or AFCv3 */
#if defined (__BOARD_ML605__) || (__BOARD_AFCV3__)
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_INFO
,
"[ebpm] Spawning default SMIOs ...
\n
"
);
err
=
devio_register_sm
(
devio
,
fmc130m_4ch_id
,
FMC1_130M_BASE_ADDR
,
0
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[ebpm] devio_register_sm error!
\n
"
);
goto
err_register_sm
;
/* Look for which FMC board to spawn */
char
hints_key
[
HUTILS_CFG_HASH_KEY_MAX_LEN
];
snprintf
(
hints_key
,
sizeof
(
hints_key
),
HUTILS_CFG_HASH_KEY_PATTERN_COMPL
,
dev_id
,
0
);
hutils_hints_t
*
cfg_item
=
zhashx_lookup
(
hints
,
hints_key
);
/* If key is not found, assume the fmc130m default FMC board */
if
(
cfg_item
==
NULL
||
cfg_item
->
fmc_board
==
NULL
||
streq
(
cfg_item
->
fmc_board
,
""
)
||
streq
(
cfg_item
->
fmc_board
,
fmc_board_130m_4ch
))
{
/* Default FMC Board */
err
=
devio_register_sm
(
devio
,
fmc130m_4ch_id
,
FMC1_130M_BASE_ADDR
,
0
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[ebpm] devio_register_sm error!
\n
"
);
goto
err_register_sm
;
}
}
else
if
(
streq
(
cfg_item
->
fmc_board
,
fmc_board_250m_4ch
))
{
/* FMC250m Board */
err
=
devio_register_sm
(
devio
,
fmc250m_4ch_id
,
FMC1_250M_BASE_ADDR
,
0
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[ebpm] devio_register_sm error!
\n
"
);
goto
err_register_sm
;
}
}
err
=
devio_register_sm
(
devio
,
acq_id
,
WB_ACQ1_BASE_ADDR
,
0
);
...
...
@@ -782,10 +807,28 @@ static devio_err_e _spawn_be_platform_smios (devio_t *devio)
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_INFO
,
"[ebpm] Spawning AFCv3 specific SMIOs ...
\n
"
);
err
=
devio_register_sm
(
devio
,
fmc130m_4ch_id
,
FMC2_130M_BASE_ADDR
,
1
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[ebpm] devio_register_sm error!
\n
"
);
goto
err_register_sm
;
snprintf
(
hints_key
,
sizeof
(
hints_key
),
HUTILS_CFG_HASH_KEY_PATTERN_COMPL
,
dev_id
,
0
);
cfg_item
=
zhashx_lookup
(
hints
,
hints_key
);
/* If key is not found, assume the fmc130m default FMC board */
if
(
cfg_item
==
NULL
||
cfg_item
->
fmc_board
==
NULL
||
streq
(
cfg_item
->
fmc_board
,
""
)
||
streq
(
cfg_item
->
fmc_board
,
fmc_board_130m_4ch
))
{
/* Default FMC Board */
err
=
devio_register_sm
(
devio
,
fmc130m_4ch_id
,
FMC2_130M_BASE_ADDR
,
1
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[ebpm] devio_register_sm error!
\n
"
);
goto
err_register_sm
;
}
}
else
if
(
streq
(
cfg_item
->
fmc_board
,
fmc_board_250m_4ch
))
{
/* FMC250m Board */
err
=
devio_register_sm
(
devio
,
fmc250m_4ch_id
,
FMC2_250M_BASE_ADDR
,
1
);
if
(
err
!=
DEVIO_SUCCESS
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[ebpm] devio_register_sm error!
\n
"
);
goto
err_register_sm
;
}
}
err
=
devio_register_sm
(
devio
,
acq_id
,
WB_ACQ2_BASE_ADDR
,
1
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment