David Hendricks | a915131 | 2013-07-01 12:21:01 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the flashrom project. |
| 3 | * |
| 4 | * Copyright 2013 Google Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #ifndef __GEC_H_ |
| 22 | #define __GEC_H_ |
| 23 | |
| 24 | /* FIXME: We should be able to forward declare enum ec_current_image here |
| 25 | * instead of including gec_ec_commands.h */ |
| 26 | #include "gec_ec_commands.h" |
| 27 | |
| 28 | struct gec_priv { |
| 29 | int detected; |
Simon Glass | 01c1167 | 2013-07-01 18:03:33 +0900 | [diff] [blame^] | 30 | enum ec_current_image current_image; |
David Hendricks | a915131 | 2013-07-01 12:21:01 -0700 | [diff] [blame] | 31 | int (*ec_command)(int command, int ver, const void *indata, int insize, |
| 32 | void *outdata, int outsize); |
| 33 | }; |
| 34 | |
| 35 | int gec_probe_size(struct flashchip *flash); |
| 36 | int gec_block_erase(struct flashchip *flash, |
| 37 | unsigned int blockaddr, unsigned int len); |
| 38 | int gec_read(struct flashchip *flash, uint8_t *readarr, |
| 39 | unsigned int blockaddr, unsigned int readcnt); |
| 40 | int gec_write(struct flashchip *flash, uint8_t *buf, unsigned int addr, |
| 41 | unsigned int nbytes); |
| 42 | |
| 43 | #endif /* __GEC_H_ */ |