mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-27 03:33:50 +00:00
Integrates the FTS driver into cgpt. This driver is binary-format compatible with the linux driver for interoperabiilty. The cgpt changes load & store a hex-encoded mtd partition table in the FTS; we need some sort of encoding because FTS only stores NUL-terminated strings. Currently, the mtd code paths aren't executed in cgpt, only in the tests. It's also not hooked up to the vboot code yet, we will need to do that eventually. BUG=chromium:221745 TEST=new unit test added BRANCH=none Change-Id: I94eb0389d29aca0beb9d9a644465c7d86161b3c2 Original-Change-Id: I9fe2fa91b666572563426adb8fa9d426f9b60bbf Reviewed-on: https://gerrit.chromium.org/gerrit/46796 Commit-Queue: Albert Chaulk <achaulk@chromium.org> Reviewed-by: Albert Chaulk <achaulk@chromium.org> Tested-by: Albert Chaulk <achaulk@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49789
36 lines
1.2 KiB
C
36 lines
1.2 KiB
C
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
#ifndef _FLASH_TS_H
|
|
#define _FLASH_TS_H
|
|
|
|
typedef struct {
|
|
unsigned int szofpg; /* Erase unit */
|
|
unsigned int szofblk; /* Write unit */
|
|
unsigned int szofsector; /* Sector size used by the rest of cgpt */
|
|
void *user;
|
|
} nand_geom;
|
|
|
|
int flash_ts_init(unsigned int start_block, unsigned int blocks,
|
|
unsigned int szofpg, unsigned int szofblk,
|
|
unsigned int szofsector, void *user);
|
|
|
|
/* Get/set value, returns 0 on success */
|
|
int flash_ts_set(const char *key, const char *value);
|
|
void flash_ts_get(const char *key, char *value, unsigned int size);
|
|
|
|
/* Get value as an integer, if missing/invalid return 'default_value' */
|
|
int flash_ts_get_int(const char *key, int default_value);
|
|
|
|
|
|
/* These must be implemented outside the driver. */
|
|
int nand_read_page(const nand_geom *nand, int page, void *buf, int size);
|
|
int nand_write_page(const nand_geom *nand, int page, const void *buf, int size);
|
|
int nand_erase_block(const nand_geom *nand, int block);
|
|
int nand_is_bad_block(const nand_geom *nand, int block);
|
|
|
|
|
|
|
|
#endif /* _FLASH_TS_H */
|