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. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | */ |
| 22 | |
| 23 | #include <stdlib.h> |
| 24 | #include <string.h> |
| 25 | #include "flash.h" |
| 26 | |
Stefan Tauner | 9b32de9 | 2014-08-08 23:52:33 +0000 | [diff] [blame] | 27 | void print_chip_support_status(const struct flashchip *chip) |
| 28 | { |
| 29 | if (chip->feature_bits & FEATURE_OTP) { |
| 30 | msg_cdbg("This chip may contain one-time programmable memory. flashrom cannot read\n" |
| 31 | "and may never be able to write it, hence it may not be able to completely\n" |
| 32 | "clone the contents of this chip (see man page for details).\n"); |
| 33 | } |
| 34 | |
| 35 | if ((chip->tested.erase == NA) && (chip->tested.write == NA)) { |
| 36 | msg_cdbg("This chip's main memory can not be erased/written by design.\n"); |
| 37 | } |
| 38 | |
| 39 | if ((chip->tested.probe == BAD) || (chip->tested.probe == NT) || |
| 40 | (chip->tested.read == BAD) || (chip->tested.read == NT) || |
| 41 | (chip->tested.erase == BAD) || (chip->tested.erase == NT) || |
| 42 | (chip->tested.write == BAD) || (chip->tested.write == NT)){ |
| 43 | msg_cinfo("===\n"); |
| 44 | if ((chip->tested.probe == BAD) || |
| 45 | (chip->tested.read == BAD) || |
| 46 | (chip->tested.erase == BAD) || |
| 47 | (chip->tested.write == BAD)) { |
| 48 | msg_cinfo("This flash part has status NOT WORKING for operations:"); |
| 49 | if (chip->tested.probe == BAD) |
| 50 | msg_cinfo(" PROBE"); |
| 51 | if (chip->tested.read == BAD) |
| 52 | msg_cinfo(" READ"); |
| 53 | if (chip->tested.erase == BAD) |
| 54 | msg_cinfo(" ERASE"); |
| 55 | if (chip->tested.write == BAD) |
| 56 | msg_cinfo(" WRITE"); |
| 57 | msg_cinfo("\n"); |
| 58 | } |
| 59 | if ((chip->tested.probe == NT) || |
| 60 | (chip->tested.read == NT) || |
| 61 | (chip->tested.erase == NT) || |
| 62 | (chip->tested.write == NT)) { |
| 63 | msg_cinfo("This flash part has status UNTESTED for operations:"); |
| 64 | if (chip->tested.probe == NT) |
| 65 | msg_cinfo(" PROBE"); |
| 66 | if (chip->tested.read == NT) |
| 67 | msg_cinfo(" READ"); |
| 68 | if (chip->tested.erase == NT) |
| 69 | msg_cinfo(" ERASE"); |
| 70 | if (chip->tested.write == NT) |
| 71 | msg_cinfo(" WRITE"); |
| 72 | msg_cinfo("\n"); |
| 73 | } |
| 74 | msg_cinfo("The test status of this chip may have been updated in the latest development\n" |
| 75 | "version of flashrom. If you are running the latest development version,\n" |
| 76 | "please email a report to flashrom@flashrom.org if any of the above operations\n" |
| 77 | "work correctly for you with this flash chip. Please include the flashrom log\n" |
| 78 | "file for all operations you tested (see the man page for details), and mention\n" |
| 79 | "which mainboard or programmer you tested in the subject line.\n" |
| 80 | "Thanks for your help!\n"); |
| 81 | } |
| 82 | } |
| 83 | |