Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions storage/gr716-flash/spimctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@
#include <sys/types.h>
#include <phoenix/arch/sparcv8leon/gr716/gr716.h>

#include <board_config.h>

#define SPIMCTRL_NUM 2

#define FLASH0_AHB_ADDR 0x02000000
#define FLASH1_AHB_ADDR 0x04000000

#ifndef SPIMCTRL0_BASE
#define SPIMCTRL0_BASE ((void *)0xFFF00100)
#endif

#ifndef SPIMCTRL1_BASE
#define SPIMCTRL1_BASE ((void *)0xFFF00200)
#endif


/* clang-format off */
Expand Down
11 changes: 10 additions & 1 deletion storage/host-flash/host-flashsrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
static struct {
pthread_mutex_t lock;
meterfs_ctx_t ctx;
} hostflashsrv_common;
} hostflashsrv_common = { 0 };


int hostflashsrv_readFile(id_t *id, off_t off, char *buff, size_t bufflen)
{
Expand Down Expand Up @@ -123,3 +124,11 @@ int hostflashsrv_init(size_t *flashsz, size_t *sectorsz, const char *fileName)

return 0;
}


#if METERFS_DEBUG_UTILS
void hostflashsrv_setDebugCtx(meterfs_debugCtx_t *ctx)
{
hostflashsrv_common.ctx.debugCtx = *ctx;
}
#endif
6 changes: 6 additions & 0 deletions storage/host-flash/host-flashsrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ int hostflashsrv_devctl(meterfs_i_devctl_t *i, meterfs_o_devctl_t *o);

int hostflashsrv_init(size_t *flashsz, size_t *sectorsz, const char *fileName);


#if METERFS_DEBUG_UTILS
/* WARN: callable before hostflashsrv_init() */
void hostflashsrv_setDebugCtx(meterfs_debugCtx_t *ctx);
#endif

#endif