1// Copyright 2018 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#pragma once
6
7#include <stdint.h>
8
9#include <zircon/device/nand.h>
10
11// Prints out some data from the "first page".
12void DumpPage0(const void* data);
13
14// Returns the location and size of the bad block table. |data| must be a Page0
15// buffer.
16void GetBbtLocation(const void* data, uint32_t* first_block, uint32_t* num_blocks);
17
18// Prints out the bad blocks from the bad block tables. Returns the number of
19// tables parsed. |data| and |oob| must contain the data from a full erase block.
20// Note that GetBbtLocation() has to be called before using this function, to
21// determine what erase blocks to read.
22int DumpBbt(const void* data, const void* oob, const nand_info_t& info);
23