Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the flashrom project. |
| 3 | * |
| 4 | * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de> |
| 5 | * Copyright (C) 2009 Carl-Daniel Hailfinger |
| 6 | * Copyright (C) 2011-2014 Stefan Tauner |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | #include <stdlib.h> |
| 20 | #include <string.h> |
| 21 | #include "flash.h" |
| 22 | |
Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 23 | void print_chip_support_status(const struct flashchip *chip) |
| 24 | { |
| 25 | if (chip->feature_bits & FEATURE_OTP) { |
Nico Huber | c3b02dc | 2023-08-12 01:13:45 +0200 | [diff] [blame^] | 26 | msg_cdbg("This chip may contain one-time programmable memory. flashprog cannot read\n" |
Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 27 | "and may never be able to write it, hence it may not be able to completely\n" |
| 28 | "clone the contents of this chip (see man page for details).\n"); |
| 29 | } |
| 30 | |
| 31 | if ((chip->tested.erase == NA) && (chip->tested.write == NA)) { |
| 32 | msg_cdbg("This chip's main memory can not be erased/written by design.\n"); |
| 33 | } |
| 34 | |
| 35 | if ((chip->tested.probe == BAD) || (chip->tested.probe == NT) || |
| 36 | (chip->tested.read == BAD) || (chip->tested.read == NT) || |
| 37 | (chip->tested.erase == BAD) || (chip->tested.erase == NT) || |
Nico Huber | bb4f3b0 | 2022-12-30 14:28:06 +0100 | [diff] [blame] | 38 | (chip->tested.write == BAD) || (chip->tested.write == NT)) { |
Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 39 | msg_cinfo("===\n"); |
| 40 | if ((chip->tested.probe == BAD) || |
| 41 | (chip->tested.read == BAD) || |
| 42 | (chip->tested.erase == BAD) || |
Nico Huber | bb4f3b0 | 2022-12-30 14:28:06 +0100 | [diff] [blame] | 43 | (chip->tested.write == BAD)) { |
Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 44 | msg_cinfo("This flash part has status NOT WORKING for operations:"); |
| 45 | if (chip->tested.probe == BAD) |
| 46 | msg_cinfo(" PROBE"); |
| 47 | if (chip->tested.read == BAD) |
| 48 | msg_cinfo(" READ"); |
| 49 | if (chip->tested.erase == BAD) |
| 50 | msg_cinfo(" ERASE"); |
| 51 | if (chip->tested.write == BAD) |
| 52 | msg_cinfo(" WRITE"); |
| 53 | msg_cinfo("\n"); |
| 54 | } |
| 55 | if ((chip->tested.probe == NT) || |
| 56 | (chip->tested.read == NT) || |
| 57 | (chip->tested.erase == NT) || |
Nico Huber | bb4f3b0 | 2022-12-30 14:28:06 +0100 | [diff] [blame] | 58 | (chip->tested.write == NT)) { |
Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 59 | msg_cinfo("This flash part has status UNTESTED for operations:"); |
| 60 | if (chip->tested.probe == NT) |
| 61 | msg_cinfo(" PROBE"); |
| 62 | if (chip->tested.read == NT) |
| 63 | msg_cinfo(" READ"); |
| 64 | if (chip->tested.erase == NT) |
| 65 | msg_cinfo(" ERASE"); |
| 66 | if (chip->tested.write == NT) |
| 67 | msg_cinfo(" WRITE"); |
| 68 | msg_cinfo("\n"); |
| 69 | } |
| 70 | msg_cinfo("The test status of this chip may have been updated in the latest development\n" |
Nico Huber | c3b02dc | 2023-08-12 01:13:45 +0200 | [diff] [blame^] | 71 | "version of flashprog. If you are running the latest development version,\n" |
| 72 | "please email a report to flashprog@flashprog.org if any of the above\n" |
Nico Huber | ac90af6 | 2022-12-18 00:22:47 +0000 | [diff] [blame] | 73 | "operations work correctly for you with this flash chip. Please include the\n" |
Nico Huber | c3b02dc | 2023-08-12 01:13:45 +0200 | [diff] [blame^] | 74 | "flashprog log file for all operations you tested (see the man page for details),\n" |
Nico Huber | ac90af6 | 2022-12-18 00:22:47 +0000 | [diff] [blame] | 75 | "and mention which mainboard or programmer you tested in the subject line.\n" |
Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 76 | "Thanks for your help!\n"); |
| 77 | } |
| 78 | } |