blob: f0d34ed92b17f296896c2a69e85b01439381405d [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", BanjoLayout = "ddk-protocol"]
protocol RawNand {
/// Read one NAND page and its out-of-band data with hardware ECC.
ReadPageHwecc(uint32 nandpage) -> (zx.status s, [Buffer] vector<uint8>:MAX data, [Buffer] vector<uint8>:MAX oob,
uint32 ecc_correct);
/// Write one NAND page and its out-of-band data with hardware ECC.
///
/// Should return ZX_ERR_IO *only* when an error ocurred due to underlying hardware.
WritePageHwecc([Buffer] vector<uint8>:MAX data, [Buffer] vector<uint8>:MAX oob, uint32 nandpage) -> (zx.status s);
/// Erase NAND block.
///
/// Should return ZX_ERR_IO *only* when error ocurred due to underlying hardware.
EraseBlock(uint32 nandpage) -> (zx.status s);
GetNandInfo() -> (zx.status s, fuchsia.hardware.nandinfo.NandInfo info);
};