blob: 84fd327c1cb297e3a527c92c7e6ddd21839d0b80 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.hardware.rawnand;
using fuchsia.hardware.nandinfo;
using zx;
@transport("Banjo")
@banjo_layout("ddk-protocol")
protocol RawNand {
/// Read one NAND page and its out-of-band data with hardware ECC.
ReadPageHwecc(struct {
nandpage uint32;
}) -> (struct {
s zx.status;
@buffer
data vector<uint8>:MAX;
@buffer
oob vector<uint8>:MAX;
ecc_correct uint32;
});
/// Write one NAND page and its out-of-band data with hardware ECC.
///
/// Should return ZX_ERR_IO *only* when an error occurred due to underlying hardware.
WritePageHwecc(struct {
@buffer
data vector<uint8>:MAX;
@buffer
oob vector<uint8>:MAX;
nandpage uint32;
}) -> (struct {
s zx.status;
});
/// Erase NAND block.
///
/// Should return ZX_ERR_IO *only* when error occurred due to underlying hardware.
EraseBlock(struct {
nandpage uint32;
}) -> (struct {
s zx.status;
});
GetNandInfo() -> (struct {
s zx.status;
info fuchsia.hardware.nandinfo.NandInfo;
});
};