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); |
Alan Green | 1fdf13b | 2019-09-16 12:54:45 +1000 | [diff] [blame] | 36 | int spi_block_erase_50(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 37 | 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] | 38 | 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] | 39 | 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] | 40 | int spi_block_erase_62(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Alan Green | 1fdf13b | 2019-09-16 12:54:45 +1000 | [diff] [blame] | 41 | int spi_block_erase_81(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 42 | 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] | 43 | int spi_block_erase_d7(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 44 | 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] | 45 | 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] | 46 | int spi_chip_write_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 47 | 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] | 48 | 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] | 49 | int spi_nbyte_read(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); |
| 50 | 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] | 51 | int spi_write_chunked(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize); |
| 52 | 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] | 53 | |
Edward O'Callaghan | 71e2314 | 2019-03-03 23:08:22 +1100 | [diff] [blame] | 54 | |
| 55 | /* spi25_statusreg.c */ |
| 56 | uint8_t spi_read_status_register(const struct flashctx *flash); |
| 57 | int spi_write_status_register(const struct flashctx *flash, int status); |
| 58 | void spi_prettyprint_status_register_bit(uint8_t status, int bit); |
| 59 | int spi_prettyprint_status_register_plain(struct flashctx *flash); |
| 60 | int spi_prettyprint_status_register_default_welwip(struct flashctx *flash); |
| 61 | int spi_prettyprint_status_register_bp1_srwd(struct flashctx *flash); |
| 62 | int spi_prettyprint_status_register_bp2_srwd(struct flashctx *flash); |
| 63 | int spi_prettyprint_status_register_bp3_srwd(struct flashctx *flash); |
| 64 | int spi_prettyprint_status_register_bp4_srwd(struct flashctx *flash); |
| 65 | int spi_prettyprint_status_register_bp2_bpl(struct flashctx *flash); |
| 66 | int spi_prettyprint_status_register_bp2_tb_bpl(struct flashctx *flash); |
| 67 | int spi_disable_blockprotect(struct flashctx *flash); |
| 68 | int spi_disable_blockprotect_bp1_srwd(struct flashctx *flash); |
| 69 | int spi_disable_blockprotect_bp2_srwd(struct flashctx *flash); |
| 70 | int spi_disable_blockprotect_bp3_srwd(struct flashctx *flash); |
| 71 | int spi_disable_blockprotect_bp4_srwd(struct flashctx *flash); |
Edward O'Callaghan | 71e2314 | 2019-03-03 23:08:22 +1100 | [diff] [blame] | 72 | int spi_prettyprint_status_register_amic_a25l032(struct flashctx *flash); |
Edward O'Callaghan | 71e2314 | 2019-03-03 23:08:22 +1100 | [diff] [blame] | 73 | int spi_prettyprint_status_register_at25df(struct flashctx *flash); |
| 74 | int spi_prettyprint_status_register_at25df_sec(struct flashctx *flash); |
| 75 | int spi_prettyprint_status_register_at25f(struct flashctx *flash); |
| 76 | int spi_prettyprint_status_register_at25f512a(struct flashctx *flash); |
| 77 | int spi_prettyprint_status_register_at25f512b(struct flashctx *flash); |
| 78 | int spi_prettyprint_status_register_at25f4096(struct flashctx *flash); |
| 79 | int spi_prettyprint_status_register_at25fs010(struct flashctx *flash); |
| 80 | int spi_prettyprint_status_register_at25fs040(struct flashctx *flash); |
| 81 | int spi_prettyprint_status_register_at26df081a(struct flashctx *flash); |
| 82 | int spi_disable_blockprotect_at2x_global_unprotect(struct flashctx *flash); |
| 83 | int spi_disable_blockprotect_at2x_global_unprotect_sec(struct flashctx *flash); |
| 84 | int spi_disable_blockprotect_at25df(struct flashctx *flash); |
| 85 | int spi_disable_blockprotect_at25df_sec(struct flashctx *flash); |
| 86 | int spi_disable_blockprotect_at25f(struct flashctx *flash); |
| 87 | int spi_disable_blockprotect_at25f512a(struct flashctx *flash); |
| 88 | int spi_disable_blockprotect_at25f512b(struct flashctx *flash); |
| 89 | int spi_disable_blockprotect_at25fs010(struct flashctx *flash); |
| 90 | int spi_disable_blockprotect_at25fs040(struct flashctx *flash); |
| 91 | int spi_prettyprint_status_register_en25s_wp(struct flashctx *flash); |
| 92 | int spi_prettyprint_status_register_n25q(struct flashctx *flash); |
| 93 | int spi_disable_blockprotect_n25q(struct flashctx *flash); |
| 94 | int spi_prettyprint_status_register_bp2_ep_srwd(struct flashctx *flash); |
| 95 | int spi_disable_blockprotect_bp2_ep_srwd(struct flashctx *flash); |
| 96 | int spi_prettyprint_status_register_sst25(struct flashctx *flash); |
| 97 | int spi_prettyprint_status_register_sst25vf016(struct flashctx *flash); |
| 98 | int spi_prettyprint_status_register_sst25vf040b(struct flashctx *flash); |
| 99 | int spi_disable_blockprotect_sst26_global_unprotect(struct flashctx *flash); |
| 100 | |
hailfinger | fe7cd9e | 2011-11-04 21:35:26 +0000 | [diff] [blame] | 101 | /* opaque.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 102 | int probe_opaque(struct flashctx *flash); |
| 103 | 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] | 104 | 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] | 105 | int erase_opaque(struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen); |
| 106 | uint8_t read_status_opaque(const struct flashctx *flash); |
| 107 | int write_status_opaque(const struct flashctx *flash, int status); |
Duncan Laurie | 25a4ca2 | 2019-04-25 12:08:52 -0700 | [diff] [blame] | 108 | 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] | 109 | |
Alan Green | dad2dae | 2019-09-16 15:55:08 +1000 | [diff] [blame^] | 110 | /* at45db.c */ |
| 111 | int probe_spi_at45db(struct flashctx *flash); |
| 112 | int spi_prettyprint_status_register_at45db(struct flashctx *flash); |
| 113 | int spi_disable_blockprotect_at45db(struct flashctx *flash); |
| 114 | int spi_read_at45db(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
| 115 | int spi_read_at45db_e8(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
| 116 | int spi_write_at45db(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 117 | int spi_erase_at45db_page(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 118 | int spi_erase_at45db_block(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 119 | int spi_erase_at45db_sector(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 120 | int spi_erase_at45db_chip(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 121 | int spi_erase_at45cs_sector(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 122 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 123 | /* 82802ab.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 124 | uint8_t wait_82802ab(struct flashctx *flash); |
| 125 | int probe_82802ab(struct flashctx *flash); |
| 126 | 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] | 127 | 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] | 128 | void print_status_82802ab(uint8_t status); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 129 | int unlock_28f004s5(struct flashctx *flash); |
| 130 | int unlock_lh28f008bjt(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 131 | |
David Hendricks | 07af3a4 | 2011-07-11 22:13:02 -0700 | [diff] [blame] | 132 | /* ichspi.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 133 | int ich_hwseq_probe(struct flashctx *flash); |
| 134 | int ich_hwseq_read(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
| 135 | int ich_hwseq_block_erase(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 136 | 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] | 137 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 138 | /* jedec.c */ |
| 139 | uint8_t oddparity(uint8_t val); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 140 | void toggle_ready_jedec(struct flashctx *flash, chipaddr dst); |
| 141 | void data_polling_jedec(struct flashctx *flash, chipaddr dst, uint8_t data); |
| 142 | int write_byte_program_jedec(struct flashctx *flash, chipaddr bios, uint8_t *src, |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 143 | chipaddr dst); |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 144 | int probe_jedec(struct flashctx *flash); |
Patrick Georgi | ab8353e | 2017-02-03 18:32:01 +0100 | [diff] [blame] | 145 | int write_jedec(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 146 | 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] | 147 | int erase_sector_jedec(struct flashctx *flash, unsigned int page, unsigned int pagesize); |
| 148 | int erase_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize); |
| 149 | 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] | 150 | |
Alan Green | d793f5b | 2019-09-02 17:03:51 +1000 | [diff] [blame] | 151 | int unlock_regspace2_uniform_32k(struct flashctx *flash); |
| 152 | int unlock_regspace2_uniform_64k(struct flashctx *flash); |
| 153 | int unlock_regspace2_block_eraser_0(struct flashctx *flash); |
| 154 | int unlock_regspace2_block_eraser_1(struct flashctx *flash); |
| 155 | int printlock_regspace2_uniform_64k(struct flashctx *flash); |
| 156 | int printlock_regspace2_block_eraser_0(struct flashctx *flash); |
| 157 | int printlock_regspace2_block_eraser_1(struct flashctx *flash); |
| 158 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 159 | /* m29f400bt.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 160 | int probe_m29f400bt(struct flashctx *flash); |
| 161 | int block_erase_m29f400bt(struct flashctx *flash, unsigned int start, unsigned int len); |
| 162 | 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] | 163 | 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] | 164 | void protect_m29f400bt(struct flashctx *flash, chipaddr bios); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 165 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 166 | /* sst28sf040.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 167 | int erase_chip_28sf040(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 168 | 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] | 169 | 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] | 170 | int unprotect_28sf040(struct flashctx *flash); |
| 171 | int protect_28sf040(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 172 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 173 | /* sst49lfxxxc.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 174 | int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address, unsigned int sector_size); |
| 175 | int unlock_49lfxxxc(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 176 | |
| 177 | /* sst_fwhub.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 178 | int printlock_sst_fwhub(struct flashctx *flash); |
| 179 | int unlock_sst_fwhub(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 180 | |
Vadim Bendebury | 3a50116 | 2014-10-21 20:38:13 -0700 | [diff] [blame] | 181 | /* s25fl.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 182 | int probe_spi_big_spansion(struct flashctx *flash); |
| 183 | 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] | 184 | |
David Hendricks | 148a4bf | 2015-03-13 21:02:42 -0700 | [diff] [blame] | 185 | /* s25f.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 186 | int s25f_get_modifier_bits(const struct flashctx *flash, struct generic_modifier_bits *m); |
| 187 | int s25f_set_modifier_bits(const struct flashctx *flash, struct generic_modifier_bits *m); |
| 188 | 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] | 189 | |
hailfinger | f899301 | 2010-12-05 16:33:59 +0000 | [diff] [blame] | 190 | /* w39.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 191 | int printlock_w39l040(struct flashctx * flash); |
| 192 | int printlock_w39v040a(struct flashctx *flash); |
| 193 | int printlock_w39v040b(struct flashctx *flash); |
| 194 | int printlock_w39v040c(struct flashctx *flash); |
| 195 | int printlock_w39v040fa(struct flashctx *flash); |
| 196 | int printlock_w39v040fb(struct flashctx *flash); |
| 197 | int printlock_w39v040fc(struct flashctx *flash); |
| 198 | int printlock_w39v080a(struct flashctx *flash); |
| 199 | int printlock_w39v080fa(struct flashctx *flash); |
| 200 | int printlock_w39v080fa_dual(struct flashctx *flash); |
| 201 | int unlock_w39v040fb(struct flashctx *flash); |
| 202 | int unlock_w39v080fa(struct flashctx *flash); |
Alan Green | ebbee92 | 2019-09-02 11:36:59 +1000 | [diff] [blame] | 203 | int printlock_at49f(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 204 | |
| 205 | /* w29ee011.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 206 | int probe_w29ee011(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 207 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 208 | /* stm50flw0x0x.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 209 | int erase_sector_stm50flw0x0x(struct flashctx *flash, unsigned int block, unsigned int blocksize); |
| 210 | int unlock_stm50flw0x0x(struct flashctx *flash); |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 211 | |
Louis Yung-Chieh Lo | e53fa0f | 2011-04-11 17:18:41 +0800 | [diff] [blame] | 212 | /* dummyflasher.c */ |
Souvik Ghosh | d75cd67 | 2016-06-17 14:21:39 -0700 | [diff] [blame] | 213 | int probe_variable_size(struct flashctx *flash); |
Louis Yung-Chieh Lo | e53fa0f | 2011-04-11 17:18:41 +0800 | [diff] [blame] | 214 | |
Boris Baykov | 64d00c7 | 2016-06-11 18:28:59 +0200 | [diff] [blame] | 215 | /* spi4ba.c */ |
| 216 | int spi_enter_4ba_b7(struct flashctx *flash); |
| 217 | int spi_enter_4ba_b7_we(struct flashctx *flash); |
Ed Swierk | 47325ff | 2017-07-03 13:02:18 -0700 | [diff] [blame] | 218 | int spi_exit_4ba_e9(struct flashctx *flash); |
| 219 | int spi_exit_4ba_e9_we(struct flashctx *flash); |
Boris Baykov | 64d00c7 | 2016-06-11 18:28:59 +0200 | [diff] [blame] | 220 | int spi_byte_program_4ba(struct flashctx *flash, unsigned int addr, uint8_t databyte); |
| 221 | int spi_nbyte_program_4ba(struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len); |
| 222 | int spi_nbyte_read_4ba(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); |
| 223 | int spi_block_erase_20_4ba(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 224 | int spi_block_erase_52_4ba(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 225 | 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] | 226 | int spi_byte_program_4ba_ereg(struct flashctx *flash, unsigned int addr, uint8_t databyte); |
| 227 | int spi_nbyte_program_4ba_ereg(struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len); |
| 228 | int spi_nbyte_read_4ba_ereg(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); |
| 229 | int spi_block_erase_20_4ba_ereg(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 230 | int spi_block_erase_52_4ba_ereg(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 231 | 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] | 232 | int spi_byte_program_4ba_direct(struct flashctx *flash, unsigned int addr, uint8_t databyte); |
| 233 | int spi_nbyte_program_4ba_direct(struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len); |
| 234 | int spi_nbyte_read_4ba_direct(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); |
| 235 | int spi_block_erase_21_4ba_direct(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 236 | int spi_block_erase_5c_4ba_direct(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 237 | 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] | 238 | |
Edward O'Callaghan | a9c8100 | 2019-02-24 15:54:40 +1100 | [diff] [blame] | 239 | /* edi.c */ |
| 240 | int edi_chip_block_erase(struct flashctx *flash, unsigned int page, unsigned int size); |
| 241 | int edi_chip_write(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 242 | int edi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
| 243 | int edi_probe_kb9012(struct flashctx *flash); |
| 244 | |
hailfinger | 088dc81 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 245 | #endif /* !__CHIPDRIVERS_H__ */ |