blob: a0b8d02b959ba38ace8bc6618508a8da9a1effe5 [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")
closed protocol RawNand {
/// Read one NAND page and its out-of-band data with hardware ECC.
strict 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.
strict 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.
strict EraseBlock(struct {
nandpage uint32;
}) -> (struct {
s zx.Status;
});
strict GetNandInfo() -> (struct {
s zx.Status;
info fuchsia.hardware.nandinfo.NandInfo;
});
};