Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [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 | |
| 19 | #include <stdlib.h> |
| 20 | #include <string.h> |
| 21 | #include "flash.h" |
| 22 | |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 23 | void print_chip_support_status(const struct flashchip *chip) |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 24 | { |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 25 | if (chip->feature_bits & FEATURE_OTP) { |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 26 | msg_cdbg("This chip may contain one-time programmable memory. " |
| 27 | "flashrom cannot read\nand may never be able to write " |
| 28 | "it, hence it may not be able to completely\n" |
| 29 | "clone the contents of this chip (see man page for " |
| 30 | "details).\n"); |
| 31 | } |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 32 | if ((chip->tested.probe != OK) || |
| 33 | (chip->tested.read != OK) || |
| 34 | (chip->tested.erase != OK) || |
Alan Green | d554282 | 2019-07-30 13:28:26 +1000 | [diff] [blame] | 35 | (chip->tested.write != OK)) { |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 36 | msg_cdbg("===\n"); |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 37 | if ((chip->tested.probe == BAD) || |
| 38 | (chip->tested.read == BAD) || |
| 39 | (chip->tested.erase == BAD) || |
Alan Green | d554282 | 2019-07-30 13:28:26 +1000 | [diff] [blame] | 40 | (chip->tested.write == BAD)) { |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 41 | msg_cdbg("This flash part has status NOT WORKING for operations:"); |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 42 | if (chip->tested.probe == BAD) |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 43 | msg_cdbg(" PROBE"); |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 44 | if (chip->tested.read == BAD) |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 45 | msg_cdbg(" READ"); |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 46 | if (chip->tested.erase == BAD) |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 47 | msg_cdbg(" ERASE"); |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 48 | if (chip->tested.write == BAD) |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 49 | msg_cdbg(" WRITE"); |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 50 | msg_cdbg("\n"); |
| 51 | } |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 52 | if ((chip->tested.probe == NT) || |
| 53 | (chip->tested.read == NT) || |
| 54 | (chip->tested.erase == NT) || |
Alan Green | d554282 | 2019-07-30 13:28:26 +1000 | [diff] [blame] | 55 | (chip->tested.write == NT)) { |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 56 | msg_cdbg("This flash part has status UNTESTED for operations:"); |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 57 | if (chip->tested.probe == NT) |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 58 | msg_cdbg(" PROBE"); |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 59 | if (chip->tested.read == NT) |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 60 | msg_cdbg(" READ"); |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 61 | if (chip->tested.erase == NT) |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 62 | msg_cdbg(" ERASE"); |
Edward O'Callaghan | 71e30b4 | 2019-06-04 16:16:13 +1000 | [diff] [blame] | 63 | if (chip->tested.write == NT) |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 64 | msg_cdbg(" WRITE"); |
Edward O'Callaghan | 83c7700 | 2019-06-04 15:56:19 +1000 | [diff] [blame] | 65 | msg_cdbg("\n"); |
| 66 | } |
| 67 | /* FIXME: This message is designed towards CLI users. */ |
| 68 | msg_cdbg("The test status of this chip may have been updated " |
| 69 | "in the latest development\n" |
| 70 | "version of flashrom. If you are running the latest " |
| 71 | "development version,\n" |
| 72 | "please email a report to flashrom@flashrom.org if " |
| 73 | "any of the above operations\n" |
| 74 | "work correctly for you with this flash part. Please " |
| 75 | "include the flashrom\n" |
| 76 | "output with the additional -V option for all " |
| 77 | "operations you tested (-V, -Vr,\n" |
| 78 | "-VE, -Vw), and mention which mainboard or " |
| 79 | "programmer you tested.\n" |
| 80 | "Please mention your board in the subject line. " |
| 81 | "Thanks for your help!\n"); |
| 82 | } |
| 83 | } |