hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the flashrom project. |
| 3 | * |
| 4 | * Copyright (C) 2009 Carl-Daniel Hailfinger |
| 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; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 15 | * Header file for flash chip drivers. Included from flash.h. |
| 16 | * As a general rule, every function listed here should take a pointer to |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 17 | * struct flashctx as first parameter. |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #ifndef __CHIPDRIVERS_H__ |
| 21 | #define __CHIPDRIVERS_H__ 1 |
| 22 | |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 23 | #include "flash.h" /* for chipaddr and flashctx */ |
David Hendricks | 148a4bf | 2015-03-13 21:02:42 -0700 | [diff] [blame] | 24 | #include "writeprotect.h" /* for generic_modifier_bits */ |
stefanct | 8de303e | 2011-08-16 12:08:22 +0000 | [diff] [blame] | 25 | |
Edward O'Callaghan | 6bbdd32 | 2019-09-09 16:28:01 +1000 | [diff] [blame] | 26 | /* spi25.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 27 | int probe_spi_rdid(struct flashctx *flash); |
| 28 | int probe_spi_rdid4(struct flashctx *flash); |
| 29 | int probe_spi_rems(struct flashctx *flash); |
| 30 | int probe_spi_res1(struct flashctx *flash); |
| 31 | int probe_spi_res2(struct flashctx *flash); |
| 32 | int spi_write_enable(struct flashctx *flash); |
| 33 | int spi_write_disable(struct flashctx *flash); |
| 34 | int spi_block_erase_20(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Edward O'Callaghan | 94934e8 | 2019-06-19 17:44:19 +1000 | [diff] [blame] | 35 | int spi_block_erase_21(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 36 | int spi_block_erase_52(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Edward O'Callaghan | 94934e8 | 2019-06-19 17:44:19 +1000 | [diff] [blame] | 37 | int spi_block_erase_5c(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 38 | int spi_block_erase_60(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Alan Green | 5d70973 | 2019-09-16 12:32:25 +1000 | [diff] [blame] | 39 | int spi_block_erase_62(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 40 | int spi_block_erase_c7(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Patrick Georgi | 860875a | 2017-02-03 18:44:55 +0100 | [diff] [blame] | 41 | int spi_block_erase_d7(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 42 | int spi_block_erase_d8(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Edward O'Callaghan | 94934e8 | 2019-06-19 17:44:19 +1000 | [diff] [blame] | 43 | int spi_block_erase_dc(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Patrick Georgi | ab8353e | 2017-02-03 18:32:01 +0100 | [diff] [blame] | 44 | int spi_chip_write_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 45 | int spi_chip_write_256(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 46 | int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start, int unsigned len); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 47 | int spi_nbyte_read(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); |
| 48 | int spi_read_chunked(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize); |
Patrick Georgi | ab8353e | 2017-02-03 18:32:01 +0100 | [diff] [blame] | 49 | int spi_write_chunked(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize); |
| 50 | int spi_aai_write(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 51 | |
Edward O'Callaghan | 71e2314 | 2019-03-03 23:08:22 +1100 | [diff] [blame] | 52 | |
| 53 | /* spi25_statusreg.c */ |
| 54 | uint8_t spi_read_status_register(const struct flashctx *flash); |
| 55 | int spi_write_status_register(const struct flashctx *flash, int status); |
| 56 | void spi_prettyprint_status_register_bit(uint8_t status, int bit); |
| 57 | int spi_prettyprint_status_register_plain(struct flashctx *flash); |
| 58 | int spi_prettyprint_status_register_default_welwip(struct flashctx *flash); |
| 59 | int spi_prettyprint_status_register_bp1_srwd(struct flashctx *flash); |
| 60 | int spi_prettyprint_status_register_bp2_srwd(struct flashctx *flash); |
| 61 | int spi_prettyprint_status_register_bp3_srwd(struct flashctx *flash); |
| 62 | int spi_prettyprint_status_register_bp4_srwd(struct flashctx *flash); |
| 63 | int spi_prettyprint_status_register_bp2_bpl(struct flashctx *flash); |
| 64 | int spi_prettyprint_status_register_bp2_tb_bpl(struct flashctx *flash); |
| 65 | int spi_disable_blockprotect(struct flashctx *flash); |
| 66 | int spi_disable_blockprotect_bp1_srwd(struct flashctx *flash); |
| 67 | int spi_disable_blockprotect_bp2_srwd(struct flashctx *flash); |
| 68 | int spi_disable_blockprotect_bp3_srwd(struct flashctx *flash); |
| 69 | int spi_disable_blockprotect_bp4_srwd(struct flashctx *flash); |
Edward O'Callaghan | 71e2314 | 2019-03-03 23:08:22 +1100 | [diff] [blame] | 70 | int spi_prettyprint_status_register_amic_a25l032(struct flashctx *flash); |
Edward O'Callaghan | 71e2314 | 2019-03-03 23:08:22 +1100 | [diff] [blame] | 71 | int spi_prettyprint_status_register_at25df(struct flashctx *flash); |
| 72 | int spi_prettyprint_status_register_at25df_sec(struct flashctx *flash); |
| 73 | int spi_prettyprint_status_register_at25f(struct flashctx *flash); |
| 74 | int spi_prettyprint_status_register_at25f512a(struct flashctx *flash); |
| 75 | int spi_prettyprint_status_register_at25f512b(struct flashctx *flash); |
| 76 | int spi_prettyprint_status_register_at25f4096(struct flashctx *flash); |
| 77 | int spi_prettyprint_status_register_at25fs010(struct flashctx *flash); |
| 78 | int spi_prettyprint_status_register_at25fs040(struct flashctx *flash); |
| 79 | int spi_prettyprint_status_register_at26df081a(struct flashctx *flash); |
| 80 | int spi_disable_blockprotect_at2x_global_unprotect(struct flashctx *flash); |
| 81 | int spi_disable_blockprotect_at2x_global_unprotect_sec(struct flashctx *flash); |
| 82 | int spi_disable_blockprotect_at25df(struct flashctx *flash); |
| 83 | int spi_disable_blockprotect_at25df_sec(struct flashctx *flash); |
| 84 | int spi_disable_blockprotect_at25f(struct flashctx *flash); |
| 85 | int spi_disable_blockprotect_at25f512a(struct flashctx *flash); |
| 86 | int spi_disable_blockprotect_at25f512b(struct flashctx *flash); |
| 87 | int spi_disable_blockprotect_at25fs010(struct flashctx *flash); |
| 88 | int spi_disable_blockprotect_at25fs040(struct flashctx *flash); |
| 89 | int spi_prettyprint_status_register_en25s_wp(struct flashctx *flash); |
| 90 | int spi_prettyprint_status_register_n25q(struct flashctx *flash); |
| 91 | int spi_disable_blockprotect_n25q(struct flashctx *flash); |
| 92 | int spi_prettyprint_status_register_bp2_ep_srwd(struct flashctx *flash); |
| 93 | int spi_disable_blockprotect_bp2_ep_srwd(struct flashctx *flash); |
| 94 | int spi_prettyprint_status_register_sst25(struct flashctx *flash); |
| 95 | int spi_prettyprint_status_register_sst25vf016(struct flashctx *flash); |
| 96 | int spi_prettyprint_status_register_sst25vf040b(struct flashctx *flash); |
| 97 | int spi_disable_blockprotect_sst26_global_unprotect(struct flashctx *flash); |
| 98 | |
hailfinger | fe7cd9e | 2011-11-04 21:35:26 +0000 | [diff] [blame] | 99 | /* opaque.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 100 | int probe_opaque(struct flashctx *flash); |
| 101 | int read_opaque(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
Patrick Georgi | ab8353e | 2017-02-03 18:32:01 +0100 | [diff] [blame] | 102 | int write_opaque(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 103 | int erase_opaque(struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen); |
| 104 | uint8_t read_status_opaque(const struct flashctx *flash); |
| 105 | int write_status_opaque(const struct flashctx *flash, int status); |
Duncan Laurie | 25a4ca2 | 2019-04-25 12:08:52 -0700 | [diff] [blame] | 106 | int check_access_opaque(const struct flashctx *flash, unsigned int start, unsigned int len, int read); |
hailfinger | fe7cd9e | 2011-11-04 21:35:26 +0000 | [diff] [blame] | 107 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 108 | /* 82802ab.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 109 | uint8_t wait_82802ab(struct flashctx *flash); |
| 110 | int probe_82802ab(struct flashctx *flash); |
| 111 | int erase_block_82802ab(struct flashctx *flash, unsigned int page, unsigned int pagesize); |
Patrick Georgi | ab8353e | 2017-02-03 18:32:01 +0100 | [diff] [blame] | 112 | int write_82802ab(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
snelson | c0acbeb | 2010-03-19 18:47:06 +0000 | [diff] [blame] | 113 | void print_status_82802ab(uint8_t status); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 114 | int unlock_28f004s5(struct flashctx *flash); |
| 115 | int unlock_lh28f008bjt(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 116 | |
David Hendricks | 07af3a4 | 2011-07-11 22:13:02 -0700 | [diff] [blame] | 117 | /* ichspi.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 118 | int ich_hwseq_probe(struct flashctx *flash); |
| 119 | int ich_hwseq_read(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
| 120 | int ich_hwseq_block_erase(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 121 | int ich_hwseq_write_256(struct flashctx *flash, uint8_t *buf, int start, int len); |
David Hendricks | 07af3a4 | 2011-07-11 22:13:02 -0700 | [diff] [blame] | 122 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 123 | /* jedec.c */ |
| 124 | uint8_t oddparity(uint8_t val); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 125 | void toggle_ready_jedec(struct flashctx *flash, chipaddr dst); |
| 126 | void data_polling_jedec(struct flashctx *flash, chipaddr dst, uint8_t data); |
| 127 | int write_byte_program_jedec(struct flashctx *flash, chipaddr bios, uint8_t *src, |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 128 | chipaddr dst); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 129 | int probe_jedec(struct flashctx *flash); |
Patrick Georgi | ab8353e | 2017-02-03 18:32:01 +0100 | [diff] [blame] | 130 | int write_jedec(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 131 | int write_jedec_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 132 | int erase_sector_jedec(struct flashctx *flash, unsigned int page, unsigned int pagesize); |
| 133 | int erase_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize); |
| 134 | int erase_chip_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 135 | |
Alan Green | d793f5b | 2019-09-02 17:03:51 +1000 | [diff] [blame] | 136 | int unlock_regspace2_uniform_32k(struct flashctx *flash); |
| 137 | int unlock_regspace2_uniform_64k(struct flashctx *flash); |
| 138 | int unlock_regspace2_block_eraser_0(struct flashctx *flash); |
| 139 | int unlock_regspace2_block_eraser_1(struct flashctx *flash); |
| 140 | int printlock_regspace2_uniform_64k(struct flashctx *flash); |
| 141 | int printlock_regspace2_block_eraser_0(struct flashctx *flash); |
| 142 | int printlock_regspace2_block_eraser_1(struct flashctx *flash); |
| 143 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 144 | /* m29f400bt.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 145 | int probe_m29f400bt(struct flashctx *flash); |
| 146 | int block_erase_m29f400bt(struct flashctx *flash, unsigned int start, unsigned int len); |
| 147 | int block_erase_chip_m29f400bt(struct flashctx *flash, unsigned int start, unsigned int len); |
Patrick Georgi | ab8353e | 2017-02-03 18:32:01 +0100 | [diff] [blame] | 148 | int write_m29f400bt(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 149 | void protect_m29f400bt(struct flashctx *flash, chipaddr bios); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 150 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 151 | /* sst28sf040.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 152 | int erase_chip_28sf040(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 153 | int erase_sector_28sf040(struct flashctx *flash, unsigned int address, unsigned int sector_size); |
Patrick Georgi | ab8353e | 2017-02-03 18:32:01 +0100 | [diff] [blame] | 154 | int write_28sf040(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 155 | int unprotect_28sf040(struct flashctx *flash); |
| 156 | int protect_28sf040(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 157 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 158 | /* sst49lfxxxc.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 159 | int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address, unsigned int sector_size); |
| 160 | int unlock_49lfxxxc(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 161 | |
| 162 | /* sst_fwhub.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 163 | int printlock_sst_fwhub(struct flashctx *flash); |
| 164 | int unlock_sst_fwhub(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 165 | |
Vadim Bendebury | 3a50116 | 2014-10-21 20:38:13 -0700 | [diff] [blame] | 166 | /* s25fl.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 167 | int probe_spi_big_spansion(struct flashctx *flash); |
| 168 | int s25fl_block_erase(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Vadim Bendebury | 3a50116 | 2014-10-21 20:38:13 -0700 | [diff] [blame] | 169 | |
David Hendricks | 148a4bf | 2015-03-13 21:02:42 -0700 | [diff] [blame] | 170 | /* s25f.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 171 | int s25f_get_modifier_bits(const struct flashctx *flash, struct generic_modifier_bits *m); |
| 172 | int s25f_set_modifier_bits(const struct flashctx *flash, struct generic_modifier_bits *m); |
| 173 | int s25fs_block_erase_d8(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
David Hendricks | 398714f | 2014-07-03 17:49:41 -0700 | [diff] [blame] | 174 | |
hailfinger | f899301 | 2010-12-05 16:33:59 +0000 | [diff] [blame] | 175 | /* w39.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 176 | int printlock_w39l040(struct flashctx * flash); |
| 177 | int printlock_w39v040a(struct flashctx *flash); |
| 178 | int printlock_w39v040b(struct flashctx *flash); |
| 179 | int printlock_w39v040c(struct flashctx *flash); |
| 180 | int printlock_w39v040fa(struct flashctx *flash); |
| 181 | int printlock_w39v040fb(struct flashctx *flash); |
| 182 | int printlock_w39v040fc(struct flashctx *flash); |
| 183 | int printlock_w39v080a(struct flashctx *flash); |
| 184 | int printlock_w39v080fa(struct flashctx *flash); |
| 185 | int printlock_w39v080fa_dual(struct flashctx *flash); |
| 186 | int unlock_w39v040fb(struct flashctx *flash); |
| 187 | int unlock_w39v080fa(struct flashctx *flash); |
Alan Green | ebbee92 | 2019-09-02 11:36:59 +1000 | [diff] [blame] | 188 | int printlock_at49f(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 189 | |
| 190 | /* w29ee011.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 191 | int probe_w29ee011(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 192 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 193 | /* stm50flw0x0x.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 194 | int erase_sector_stm50flw0x0x(struct flashctx *flash, unsigned int block, unsigned int blocksize); |
| 195 | int unlock_stm50flw0x0x(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 196 | |
Louis Yung-Chieh Lo | e53fa0f | 2011-04-11 17:18:41 +0800 | [diff] [blame] | 197 | /* dummyflasher.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 198 | int probe_variable_size(struct flashctx *flash); |
Louis Yung-Chieh Lo | e53fa0f | 2011-04-11 17:18:41 +0800 | [diff] [blame] | 199 | |
Boris Baykov | 64d00c7 | 2016-06-11 18:28:59 +0200 | [diff] [blame] | 200 | /* spi4ba.c */ |
| 201 | int spi_enter_4ba_b7(struct flashctx *flash); |
| 202 | int spi_enter_4ba_b7_we(struct flashctx *flash); |
Ed Swierk | 47325ff | 2017-07-03 13:02:18 -0700 | [diff] [blame] | 203 | int spi_exit_4ba_e9(struct flashctx *flash); |
| 204 | int spi_exit_4ba_e9_we(struct flashctx *flash); |
Boris Baykov | 64d00c7 | 2016-06-11 18:28:59 +0200 | [diff] [blame] | 205 | int spi_byte_program_4ba(struct flashctx *flash, unsigned int addr, uint8_t databyte); |
| 206 | int spi_nbyte_program_4ba(struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len); |
| 207 | int spi_nbyte_read_4ba(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); |
| 208 | int spi_block_erase_20_4ba(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 209 | int spi_block_erase_52_4ba(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 210 | int spi_block_erase_d8_4ba(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Boris Baykov | 1a0e6d4 | 2016-06-11 18:29:02 +0200 | [diff] [blame] | 211 | int spi_byte_program_4ba_ereg(struct flashctx *flash, unsigned int addr, uint8_t databyte); |
| 212 | int spi_nbyte_program_4ba_ereg(struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len); |
| 213 | int spi_nbyte_read_4ba_ereg(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); |
| 214 | int spi_block_erase_20_4ba_ereg(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 215 | int spi_block_erase_52_4ba_ereg(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 216 | int spi_block_erase_d8_4ba_ereg(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Boris Baykov | 6323c24 | 2016-06-11 18:29:03 +0200 | [diff] [blame] | 217 | int spi_byte_program_4ba_direct(struct flashctx *flash, unsigned int addr, uint8_t databyte); |
| 218 | int spi_nbyte_program_4ba_direct(struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len); |
| 219 | int spi_nbyte_read_4ba_direct(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); |
| 220 | int spi_block_erase_21_4ba_direct(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 221 | int spi_block_erase_5c_4ba_direct(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 222 | int spi_block_erase_dc_4ba_direct(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Boris Baykov | 64d00c7 | 2016-06-11 18:28:59 +0200 | [diff] [blame] | 223 | |
Edward O'Callaghan | a9c8100 | 2019-02-24 15:54:40 +1100 | [diff] [blame] | 224 | /* edi.c */ |
| 225 | int edi_chip_block_erase(struct flashctx *flash, unsigned int page, unsigned int size); |
| 226 | int edi_chip_write(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 227 | int edi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
| 228 | int edi_probe_kb9012(struct flashctx *flash); |
| 229 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 230 | #endif /* !__CHIPDRIVERS_H__ */ |