Skip to content

Commit

Permalink
MB85RSxx FRAM bringup (#1757)
Browse files Browse the repository at this point in the history
This branch adds an initial implementation of a driver for the Fujitsu
MB85xx series of ferroelectric RAM (FRAM) devices, as seen in Power
Shelf Controller rev C boards. The FRAM chip is a SPI device with a
fairly simple protocol, detailed in [the Fujitsu datasheet][1]. It also
has additional pins for toggling the write protection feature (which can
also be controlled over SPI) and a "hold" pin to maintain a read/write
transaction when CS is deasserted, but my driver doesn't currently use
those pins because we don't *really* need them.

I've also included a simple demo task which writes some data to a FRAM
device and checks whether it can be read back. Eventually, I'd like to
replace this with a more general-purpose "read the contents of the FRAM"
task that can be used for debugging purposes, but I've left it as is for
now in the interests of getting the driver implementation ready to
merge. I'll revisit this later.

[1]: https://www.mouser.com/datasheet/2/1113/MB85RS64T_DS501_00051_2v0_E-2329177.pdf
  • Loading branch information
hawkw committed Jun 11, 2024
1 parent 2f3f789 commit ceb2908
Show file tree
Hide file tree
Showing 9 changed files with 581 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/psc/base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fwid = true

[kernel]
name = "psc"
requires = {flash = 32768, ram = 5080}
requires = {flash = 32868, ram = 5216}
features = ["dump"]

[caboose]
Expand Down
8 changes: 8 additions & 0 deletions app/psc/rev-c-dev.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
name = "psc-c-dev"
inherit = ["rev-c.toml", "dev.toml"]

[tasks.framulator]
name = "task-framulator"
priority = 5
start = true
task-slots = [{spi_driver = "spi2_driver"}]
stacksize = 2048
notifications = ["hey-you"]
12 changes: 12 additions & 0 deletions app/psc/rev-c.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@ name = "psc-c"
board = "psc-c"

inherit = "base.toml"

# N.B. that the FRAM device is only present on rev-C PSC boards and later, so
# this mux config isn't needed on earlier revisions.
[config.spi.spi2.mux_options.port_b]
outputs = [
{port = "B", pins = [13, 15], af = 5},
]
input = {port = "B", pin = 14, af = 5}

[config.spi.spi2.devices.mb86rs64t]
mux = "port_b"
cs = [{port = "B", pin = 12}]
20 changes: 20 additions & 0 deletions drv/mb85rsxx-fram/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "drv-mb85rsxx-fram"
version = "0.1.0"
edition = "2021"

[dependencies]
bitflags = { workspace = true }

drv-spi-api = { path = "../spi-api" }
counters = { path = "../../lib/counters" }

[lints]
workspace = true

# This section is here to discourage RLS/rust-analyzer from doing test builds,
# since test builds don't work for cross compilation.
[lib]
test = false
doctest = false
bench = false
Loading

0 comments on commit ceb2908

Please sign in to comment.