Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
bae273cf
Commit
bae273cf
authored
Dec 04, 2017
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use HAS_GENSDBFS to include/exclude sdbfs generation code
parent
a9add108
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
sdb-storage.c
dev/sdb-storage.c
+2
-6
storage.h
include/storage.h
+6
-2
cmd_sdb.c
shell/cmd_sdb.c
+2
-5
No files found.
dev/sdb-storage.c
View file @
bae273cf
...
...
@@ -757,8 +757,6 @@ int storage_read_hdl_cfg(void)
return
0
;
}
#ifdef CONFIG_GENSDBFS
extern
uint32_t
_binary_tools_sdbfs_default_bin_start
[];
extern
uint32_t
_binary_tools_sdbfs_default_bin_end
[];
...
...
@@ -770,7 +768,7 @@ static inline unsigned long SDB_ALIGN(unsigned long x, int blocksize)
int
storage_sdbfs_erase
(
int
mem_type
,
uint32_t
base_adr
,
uint32_t
blocksize
,
uint8_t
i2c_adr
)
{
if
(
mem_type
==
MEM_FLASH
&&
blocksize
==
0
)
if
(
!
HAS_GENSDBFS
||
(
mem_type
==
MEM_FLASH
&&
blocksize
==
0
)
)
return
-
EINVAL
;
if
(
mem_type
==
MEM_FLASH
)
{
...
...
@@ -805,7 +803,7 @@ int storage_gensdbfs(int mem_type, uint32_t base_adr, uint32_t blocksize,
int
cur_adr
,
size
;
uint32_t
val
;
if
(
mem_type
==
MEM_FLASH
&&
base_adr
==
0
)
if
(
!
HAS_GENSDBFS
||
(
mem_type
==
MEM_FLASH
&&
base_adr
==
0
)
)
return
-
EINVAL
;
if
(
mem_type
==
MEM_FLASH
&&
blocksize
==
0
)
...
...
@@ -902,5 +900,3 @@ int storage_gensdbfs(int mem_type, uint32_t base_adr, uint32_t blocksize,
return
mem_type
;
}
#endif
include/storage.h
View file @
bae273cf
...
...
@@ -46,6 +46,12 @@
#define EE_RET_CORRPT -3
#define EE_RET_POSERR -4
#ifdef CONFIG_GENSDBFS
#define HAS_GENSDBFS 1
#else
#define HAS_GENSDBFS 0
#endif
extern
uint32_t
cal_phase_transition
;
extern
uint8_t
has_eeprom
;
...
...
@@ -86,11 +92,9 @@ extern struct storage_config storage_cfg;
int
storage_read_hdl_cfg
(
void
);
#ifdef CONFIG_GENSDBFS
int
storage_sdbfs_erase
(
int
mem_type
,
uint32_t
base_adr
,
uint32_t
blocksize
,
uint8_t
i2c_adr
);
int
storage_gensdbfs
(
int
mem_type
,
uint32_t
base_adr
,
uint32_t
blocksize
,
uint8_t
i2c_adr
);
#endif
#endif
shell/cmd_sdb.c
View file @
bae273cf
...
...
@@ -20,17 +20,14 @@
static
int
cmd_sdb
(
const
char
*
args
[])
{
#ifdef CONFIG_GENSDBFS
uint8_t
i2c_adr
=
FMC_EEPROM_ADR
;
int
blocksize
=
1
;
#endif
if
(
!
args
[
0
])
{
sdb_print_devices
();
return
0
;
}
#ifdef CONFIG_GENSDBFS
if
(
!
args
[
1
])
if
(
!
args
[
1
]
||
!
HAS_GENSDBFS
)
return
-
EINVAL
;
/* interpret args[3] as i2c adr or blocksize depending on memory type */
...
...
@@ -67,7 +64,7 @@ static int cmd_sdb(const char *args[])
storage_cfg
.
blocksize
,
0
);
return
0
;
}
#endif
return
-
EINVAL
;
}
...
...
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