-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: implement generic extensible flash driver
JIRA: RTOS-951
- Loading branch information
Showing
27 changed files
with
1,644 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
# Copyright 2024 Phoenix Systems | ||
# | ||
|
||
DEFAULT_COMPONENTS := grlib-uart | ||
DEFAULT_COMPONENTS := grlib-uart flashdrv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# Makefile for Phoenix-RTOS ftmctrl-flash driver | ||
# | ||
# Copyright 2023-2025 Phoenix Systems | ||
# | ||
|
||
NAME := flashdrv | ||
LOCAL_SRCS := common.c flashsrv.c | ||
DEP_LIBS := libftmctrl libspimctrl | ||
LIBS := libjffs2 libstorage libmtd libptable libcache | ||
|
||
include $(binary.mk) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Phoenix-RTOS | ||
* | ||
* GRLIB FTMCTRL Flash driver | ||
* | ||
* Common auxiliary functions | ||
* | ||
* Copyright 2025 Phoenix Systems | ||
* Author: Lukasz Leczkowski | ||
* | ||
* This file is part of Phoenix-RTOS. | ||
* | ||
* %LICENSE% | ||
*/ | ||
|
||
#include <flashdrv/common.h> | ||
|
||
|
||
off_t common_getSectorOffset(size_t sectorsz, off_t offs) | ||
{ | ||
return offs & ~(sectorsz - 1); | ||
} | ||
|
||
|
||
bool common_isValidAddress(size_t memsz, off_t offs, size_t len) | ||
{ | ||
return ((offs < memsz) && ((offs + len) <= memsz)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# | ||
# Makefile for Phoenix-RTOS libftmctrl driver | ||
# | ||
# Copyright 2025 Phoenix Systems | ||
# | ||
|
||
NAME := libftmctrl | ||
LOCAL_SRCS := amd-flash.c flashdrv.c flash.c intel-flash.c | ||
|
||
include $(static-lib.mk) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.