Carl-Daniel Hailfinger | 5d5c072 | 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 | * |
Carl-Daniel Hailfinger | 5d5c072 | 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 |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 17 | * struct flashctx as first parameter. |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #ifndef __CHIPDRIVERS_H__ |
| 21 | #define __CHIPDRIVERS_H__ 1 |
| 22 | |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 23 | #include "flash.h" /* for chipaddr and flashctx */ |
Stefan Tauner | a63c7c4 | 2011-08-16 12:08:22 +0000 | [diff] [blame] | 24 | |
Stefan Tauner | eb58257 | 2012-09-21 12:52:50 +0000 | [diff] [blame] | 25 | /* spi.c */ |
Mark Marshall | f20b7be | 2014-05-09 21:16:21 +0000 | [diff] [blame] | 26 | int spi_aai_write(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 27 | int spi_chip_write_256(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Stefan Tauner | eb58257 | 2012-09-21 12:52:50 +0000 | [diff] [blame] | 28 | int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start, int unsigned len); |
| 29 | |
| 30 | /* spi25.c */ |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 31 | int probe_spi_rdid(struct flashctx *flash); |
| 32 | int probe_spi_rdid4(struct flashctx *flash); |
| 33 | int probe_spi_rems(struct flashctx *flash); |
| 34 | int probe_spi_res1(struct flashctx *flash); |
| 35 | int probe_spi_res2(struct flashctx *flash); |
Stefan Tauner | 3f5e35d | 2013-04-19 01:58:33 +0000 | [diff] [blame] | 36 | int probe_spi_res3(struct flashctx *flash); |
Stefan Tauner | 57794ac | 2012-12-29 15:04:20 +0000 | [diff] [blame] | 37 | int probe_spi_at25f(struct flashctx *flash); |
Carl-Daniel Hailfinger | 8a3c60c | 2011-12-18 15:01:24 +0000 | [diff] [blame] | 38 | int spi_write_enable(struct flashctx *flash); |
| 39 | int spi_write_disable(struct flashctx *flash); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 40 | int spi_block_erase_20(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Nico Huber | 7e3c81a | 2017-10-14 18:56:50 +0200 | [diff] [blame] | 41 | int spi_block_erase_21(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Stefan Tauner | 94b39b4 | 2012-10-27 00:06:02 +0000 | [diff] [blame] | 42 | int spi_block_erase_50(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 43 | int spi_block_erase_52(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Nico Huber | fffc48d | 2022-05-28 14:26:06 +0200 | [diff] [blame] | 44 | int spi_block_erase_53(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Nico Huber | 7e3c81a | 2017-10-14 18:56:50 +0200 | [diff] [blame] | 45 | int spi_block_erase_5c(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 46 | int spi_block_erase_60(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Stefan Tauner | 3c0fcd0 | 2012-09-21 12:46:56 +0000 | [diff] [blame] | 47 | int spi_block_erase_62(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Stefan Tauner | 730e7e7 | 2013-05-01 14:04:19 +0000 | [diff] [blame] | 48 | int spi_block_erase_81(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Nikolay Nikolaev | 6f59b0b | 2013-06-28 21:29:51 +0000 | [diff] [blame] | 49 | int spi_block_erase_c4(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 50 | int spi_block_erase_c7(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Stefan Tauner | 730e7e7 | 2013-05-01 14:04:19 +0000 | [diff] [blame] | 51 | int spi_block_erase_d7(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 52 | int spi_block_erase_d8(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Nikolay Nikolaev | 579f1e0 | 2013-06-28 21:28:37 +0000 | [diff] [blame] | 53 | int spi_block_erase_db(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Nico Huber | 7e3c81a | 2017-10-14 18:56:50 +0200 | [diff] [blame] | 54 | int spi_block_erase_dc(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Thomas Heijligen | 3561451 | 2022-09-19 23:46:58 +0200 | [diff] [blame] | 55 | erasefunc_t *spi25_get_erasefn_from_opcode(uint8_t opcode); |
Nico Huber | 1338936 | 2024-03-05 18:35:30 +0100 | [diff] [blame^] | 56 | const uint8_t *spi_get_opcode_from_erasefn(erasefunc_t *func, bool *native_4ba); |
Mark Marshall | f20b7be | 2014-05-09 21:16:21 +0000 | [diff] [blame] | 57 | int spi_chip_write_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Carl-Daniel Hailfinger | 8a3c60c | 2011-12-18 15:01:24 +0000 | [diff] [blame] | 58 | int spi_nbyte_read(struct flashctx *flash, unsigned int addr, uint8_t *bytes, unsigned int len); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 59 | int spi_read_chunked(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize); |
Mark Marshall | f20b7be | 2014-05-09 21:16:21 +0000 | [diff] [blame] | 60 | int spi_write_chunked(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize); |
Nico Huber | fe34d2a | 2017-11-10 21:10:20 +0100 | [diff] [blame] | 61 | int spi_enter_4ba(struct flashctx *flash); |
| 62 | int spi_exit_4ba(struct flashctx *flash); |
Nico Huber | 7eb38aa | 2019-03-21 15:42:54 +0100 | [diff] [blame] | 63 | int spi_set_extended_address(struct flashctx *, uint8_t addr_high); |
Nico Huber | 7e3c81a | 2017-10-14 18:56:50 +0200 | [diff] [blame] | 64 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 65 | |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 66 | /* spi25_statusreg.c */ |
Nikolai Artemiev | 0167522 | 2021-10-20 22:30:41 +1100 | [diff] [blame] | 67 | int spi_read_register(const struct flashctx *flash, enum flash_reg reg, uint8_t *value); |
| 68 | int spi_write_register(const struct flashctx *flash, enum flash_reg reg, uint8_t value); |
Aidan Thornton | db4e87d | 2013-08-27 18:01:53 +0000 | [diff] [blame] | 69 | void spi_prettyprint_status_register_bit(uint8_t status, int bit); |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 70 | int spi_prettyprint_status_register_plain(struct flashctx *flash); |
Stefan Tauner | 278ba6e | 2013-06-28 21:28:27 +0000 | [diff] [blame] | 71 | int spi_prettyprint_status_register_default_welwip(struct flashctx *flash); |
Stefan Tauner | 12f3d51 | 2014-05-27 21:27:27 +0000 | [diff] [blame] | 72 | int spi_prettyprint_status_register_bp1_srwd(struct flashctx *flash); |
| 73 | int spi_prettyprint_status_register_bp2_srwd(struct flashctx *flash); |
| 74 | int spi_prettyprint_status_register_bp3_srwd(struct flashctx *flash); |
| 75 | int spi_prettyprint_status_register_bp4_srwd(struct flashctx *flash); |
Stefan Tauner | 85f09f7 | 2014-05-27 21:27:14 +0000 | [diff] [blame] | 76 | int spi_prettyprint_status_register_bp2_bpl(struct flashctx *flash); |
Ben Gardner | bcf6109 | 2015-11-22 02:23:31 +0000 | [diff] [blame] | 77 | int spi_prettyprint_status_register_bp2_tb_bpl(struct flashctx *flash); |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 78 | int spi_disable_blockprotect(struct flashctx *flash); |
Stefan Tauner | a60d408 | 2014-06-04 16:17:03 +0000 | [diff] [blame] | 79 | int spi_disable_blockprotect_bp1_srwd(struct flashctx *flash); |
Stefan Tauner | 278ba6e | 2013-06-28 21:28:27 +0000 | [diff] [blame] | 80 | int spi_disable_blockprotect_bp2_srwd(struct flashctx *flash); |
| 81 | int spi_disable_blockprotect_bp3_srwd(struct flashctx *flash); |
| 82 | int spi_disable_blockprotect_bp4_srwd(struct flashctx *flash); |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 83 | int spi_prettyprint_status_register_amic_a25l032(struct flashctx *flash); |
| 84 | int spi_prettyprint_status_register_at25df(struct flashctx *flash); |
| 85 | int spi_prettyprint_status_register_at25df_sec(struct flashctx *flash); |
Stefan Tauner | 57794ac | 2012-12-29 15:04:20 +0000 | [diff] [blame] | 86 | int spi_prettyprint_status_register_at25f(struct flashctx *flash); |
| 87 | int spi_prettyprint_status_register_at25f512a(struct flashctx *flash); |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 88 | int spi_prettyprint_status_register_at25f512b(struct flashctx *flash); |
Stefan Tauner | 57794ac | 2012-12-29 15:04:20 +0000 | [diff] [blame] | 89 | int spi_prettyprint_status_register_at25f4096(struct flashctx *flash); |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 90 | int spi_prettyprint_status_register_at25fs010(struct flashctx *flash); |
| 91 | int spi_prettyprint_status_register_at25fs040(struct flashctx *flash); |
| 92 | int spi_prettyprint_status_register_at26df081a(struct flashctx *flash); |
Stefan Tauner | cecb2c5 | 2013-06-20 22:55:41 +0000 | [diff] [blame] | 93 | int spi_disable_blockprotect_at2x_global_unprotect(struct flashctx *flash); |
| 94 | int spi_disable_blockprotect_at2x_global_unprotect_sec(struct flashctx *flash); |
Stefan Tauner | 57794ac | 2012-12-29 15:04:20 +0000 | [diff] [blame] | 95 | int spi_disable_blockprotect_at25f(struct flashctx *flash); |
| 96 | int spi_disable_blockprotect_at25f512a(struct flashctx *flash); |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 97 | int spi_disable_blockprotect_at25f512b(struct flashctx *flash); |
| 98 | int spi_disable_blockprotect_at25fs010(struct flashctx *flash); |
| 99 | int spi_disable_blockprotect_at25fs040(struct flashctx *flash); |
Nikolay Nikolaev | d0e3ea1 | 2013-06-28 21:29:08 +0000 | [diff] [blame] | 100 | int spi_prettyprint_status_register_en25s_wp(struct flashctx *flash); |
Nikolay Nikolaev | 6f59b0b | 2013-06-28 21:29:51 +0000 | [diff] [blame] | 101 | int spi_prettyprint_status_register_n25q(struct flashctx *flash); |
| 102 | int spi_disable_blockprotect_n25q(struct flashctx *flash); |
Nikolay Nikolaev | c80c4a3 | 2013-06-28 21:29:44 +0000 | [diff] [blame] | 103 | int spi_prettyprint_status_register_bp2_ep_srwd(struct flashctx *flash); |
| 104 | int spi_disable_blockprotect_bp2_ep_srwd(struct flashctx *flash); |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 105 | int spi_prettyprint_status_register_sst25(struct flashctx *flash); |
| 106 | int spi_prettyprint_status_register_sst25vf016(struct flashctx *flash); |
| 107 | int spi_prettyprint_status_register_sst25vf040b(struct flashctx *flash); |
Wei Hu | 25584de | 2018-04-30 14:02:08 -0700 | [diff] [blame] | 108 | int spi_disable_blockprotect_sst26_global_unprotect(struct flashctx *flash); |
Stefan Tauner | 6ee37e2 | 2012-12-29 15:03:51 +0000 | [diff] [blame] | 109 | |
Stefan Tauner | ac1b4c8 | 2012-02-17 14:51:04 +0000 | [diff] [blame] | 110 | /* sfdp.c */ |
| 111 | int probe_spi_sfdp(struct flashctx *flash); |
| 112 | |
Carl-Daniel Hailfinger | 532c717 | 2011-11-04 21:35:26 +0000 | [diff] [blame] | 113 | /* opaque.c */ |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 114 | int probe_opaque(struct flashctx *flash); |
| 115 | int read_opaque(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
Mark Marshall | f20b7be | 2014-05-09 21:16:21 +0000 | [diff] [blame] | 116 | int write_opaque(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 117 | int erase_opaque(struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen); |
Carl-Daniel Hailfinger | 532c717 | 2011-11-04 21:35:26 +0000 | [diff] [blame] | 118 | |
Aidan Thornton | db4e87d | 2013-08-27 18:01:53 +0000 | [diff] [blame] | 119 | /* at45db.c */ |
| 120 | int probe_spi_at45db(struct flashctx *flash); |
| 121 | int spi_prettyprint_status_register_at45db(struct flashctx *flash); |
| 122 | int spi_disable_blockprotect_at45db(struct flashctx *flash); |
| 123 | int spi_read_at45db(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
Stefan Tauner | fdc4f7e | 2013-08-27 18:02:12 +0000 | [diff] [blame] | 124 | int spi_read_at45db_e8(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
Mark Marshall | f20b7be | 2014-05-09 21:16:21 +0000 | [diff] [blame] | 125 | int spi_write_at45db(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Aidan Thornton | db4e87d | 2013-08-27 18:01:53 +0000 | [diff] [blame] | 126 | int spi_erase_at45db_page(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 127 | int spi_erase_at45db_block(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 128 | int spi_erase_at45db_sector(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 129 | int spi_erase_at45db_chip(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Stefan Tauner | 1dd5d3a | 2013-08-27 18:02:19 +0000 | [diff] [blame] | 130 | int spi_erase_at45cs_sector(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
Aidan Thornton | db4e87d | 2013-08-27 18:01:53 +0000 | [diff] [blame] | 131 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 132 | /* 82802ab.c */ |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 133 | uint8_t wait_82802ab(struct flashctx *flash); |
| 134 | int probe_82802ab(struct flashctx *flash); |
| 135 | int erase_block_82802ab(struct flashctx *flash, unsigned int page, unsigned int pagesize); |
Mark Marshall | f20b7be | 2014-05-09 21:16:21 +0000 | [diff] [blame] | 136 | int write_82802ab(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Sean Nelson | 28accc2 | 2010-03-19 18:47:06 +0000 | [diff] [blame] | 137 | void print_status_82802ab(uint8_t status); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 138 | int unlock_28f004s5(struct flashctx *flash); |
| 139 | int unlock_lh28f008bjt(struct flashctx *flash); |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 140 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 141 | /* jedec.c */ |
| 142 | uint8_t oddparity(uint8_t val); |
Stefan Tauner | 0ab1e5d | 2014-05-29 11:51:24 +0000 | [diff] [blame] | 143 | void toggle_ready_jedec(const struct flashctx *flash, chipaddr dst); |
| 144 | void data_polling_jedec(const struct flashctx *flash, chipaddr dst, uint8_t data); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 145 | int probe_jedec(struct flashctx *flash); |
Stefan Tauner | 03a9c3c | 2014-08-03 14:15:14 +0000 | [diff] [blame] | 146 | int probe_jedec_29gl(struct flashctx *flash); |
Mark Marshall | f20b7be | 2014-05-09 21:16:21 +0000 | [diff] [blame] | 147 | int write_jedec(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 148 | int write_jedec_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 149 | int erase_sector_jedec(struct flashctx *flash, unsigned int page, unsigned int pagesize); |
| 150 | int erase_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize); |
| 151 | int erase_chip_block_jedec(struct flashctx *flash, unsigned int page, unsigned int blocksize); |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 152 | |
Carl-Daniel Hailfinger | ef3ac8a | 2014-08-03 13:05:34 +0000 | [diff] [blame] | 153 | int unlock_regspace2_uniform_32k(struct flashctx *flash); |
| 154 | int unlock_regspace2_uniform_64k(struct flashctx *flash); |
| 155 | int unlock_regspace2_block_eraser_0(struct flashctx *flash); |
| 156 | int unlock_regspace2_block_eraser_1(struct flashctx *flash); |
Carl-Daniel Hailfinger | ef3ac8a | 2014-08-03 13:05:34 +0000 | [diff] [blame] | 157 | int printlock_regspace2_uniform_64k(struct flashctx *flash); |
| 158 | int printlock_regspace2_block_eraser_0(struct flashctx *flash); |
| 159 | int printlock_regspace2_block_eraser_1(struct flashctx *flash); |
| 160 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 161 | /* sst28sf040.c */ |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 162 | int erase_chip_28sf040(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 163 | int erase_sector_28sf040(struct flashctx *flash, unsigned int address, unsigned int sector_size); |
Edward O'Callaghan | d1fbc46 | 2020-12-19 11:57:30 +1100 | [diff] [blame] | 164 | int write_28sf040(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 165 | int unprotect_28sf040(struct flashctx *flash); |
| 166 | int protect_28sf040(struct flashctx *flash); |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 167 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 168 | /* sst49lfxxxc.c */ |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 169 | int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address, unsigned int sector_size); |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 170 | |
| 171 | /* sst_fwhub.c */ |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 172 | int printlock_sst_fwhub(struct flashctx *flash); |
| 173 | int unlock_sst_fwhub(struct flashctx *flash); |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 174 | |
Carl-Daniel Hailfinger | 9188240 | 2010-12-05 16:33:59 +0000 | [diff] [blame] | 175 | /* w39.c */ |
Kyösti Mälkki | c31243e | 2012-10-28 01:50:08 +0000 | [diff] [blame] | 176 | int printlock_w39f010(struct flashctx * flash); |
| 177 | int printlock_w39l010(struct flashctx * flash); |
| 178 | int printlock_w39l020(struct flashctx * flash); |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 179 | int printlock_w39l040(struct flashctx * flash); |
| 180 | int printlock_w39v040a(struct flashctx *flash); |
| 181 | int printlock_w39v040b(struct flashctx *flash); |
| 182 | int printlock_w39v040c(struct flashctx *flash); |
| 183 | int printlock_w39v040fa(struct flashctx *flash); |
| 184 | int printlock_w39v040fb(struct flashctx *flash); |
| 185 | int printlock_w39v040fc(struct flashctx *flash); |
| 186 | int printlock_w39v080a(struct flashctx *flash); |
| 187 | int printlock_w39v080fa(struct flashctx *flash); |
| 188 | int printlock_w39v080fa_dual(struct flashctx *flash); |
David Borg | f5a30f6 | 2012-04-15 13:16:32 +0000 | [diff] [blame] | 189 | int printlock_at49f(struct flashctx *flash); |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 190 | |
| 191 | /* w29ee011.c */ |
Carl-Daniel Hailfinger | 63fd902 | 2011-12-14 22:25:15 +0000 | [diff] [blame] | 192 | int probe_w29ee011(struct flashctx *flash); |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 193 | |
Stefan Tauner | 4404f73 | 2013-09-12 08:28:56 +0000 | [diff] [blame] | 194 | /* stm50.c */ |
| 195 | int erase_sector_stm50(struct flashctx *flash, unsigned int block, unsigned int blocksize); |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 196 | |
Rudolf Marek | 47eff6b | 2012-04-14 22:51:40 +0000 | [diff] [blame] | 197 | /* en29lv640b.c */ |
| 198 | int probe_en29lv640b(struct flashctx *flash); |
Mark Marshall | f20b7be | 2014-05-09 21:16:21 +0000 | [diff] [blame] | 199 | int write_en29lv640b(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
Rudolf Marek | 47eff6b | 2012-04-14 22:51:40 +0000 | [diff] [blame] | 200 | |
Paul Kocialkowski | 80ae14e | 2018-01-15 01:07:46 +0300 | [diff] [blame] | 201 | /* edi.c */ |
| 202 | int edi_chip_block_erase(struct flashctx *flash, unsigned int page, unsigned int size); |
| 203 | int edi_chip_write(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); |
| 204 | int edi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); |
| 205 | int edi_probe_kb9012(struct flashctx *flash); |
| 206 | |
Konstantin Grudnev | 3d8868c | 2019-07-23 00:48:54 +0300 | [diff] [blame] | 207 | /* spi95.c */ |
| 208 | int probe_spi_st95(struct flashctx *flash); |
| 209 | int spi_block_erase_emulation(struct flashctx *flash, unsigned int addr, unsigned int blocklen); |
| 210 | |
Nikolai Artemiev | c9feb1b | 2021-10-21 01:35:13 +1100 | [diff] [blame] | 211 | /* writeprotect_ranges.c */ |
| 212 | void decode_range_spi25(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len); |
Sergii Dmytruk | 39687ac | 2022-07-25 00:23:25 +0300 | [diff] [blame] | 213 | void decode_range_spi25_64k_block(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len); |
| 214 | void decode_range_spi25_bit_cmp(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len); |
| 215 | void decode_range_spi25_2x_block(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len); |
Nikolai Artemiev | c9feb1b | 2021-10-21 01:35:13 +1100 | [diff] [blame] | 216 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 217 | #endif /* !__CHIPDRIVERS_H__ */ |