blob: 1aaaec651cc1c74a36a4fbd2e7dcbf6610117121 [file] [log] [blame] [edit]
// 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.
@available(added=HEAD)
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;
});
};