blob: 5e74e32d1473afc2bb411cc58bb9b9c37ba00aed [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 ocurred 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 ocurred due to underlying hardware.
EraseBlock(struct {
nandpage uint32;
}) -> (struct {
s zx.status;
});
GetNandInfo() -> (struct {
s zx.status;
info fuchsia.hardware.nandinfo.NandInfo;
});
};