blob: 93758590be3c001ab53c83afb3a8c7619b9335f8 [file] [log] [blame]
Edward O'Callaghan83c77002019-06-04 15:56:19 +10001/*
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'Callaghan71e30b42019-06-04 16:16:13 +100023void print_chip_support_status(const struct flashchip *chip)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100024{
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100025 if (chip->feature_bits & FEATURE_OTP) {
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100026 msg_cdbg("This chip may contain one-time programmable memory. flashrom cannot read\n"
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");
Edward O'Callaghan83c77002019-06-04 15:56:19 +100029 }
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100030
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) ||
38 (chip->tested.write == BAD) || (chip->tested.write == NT)){
39 msg_cinfo("===\n");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100040 if ((chip->tested.probe == BAD) ||
41 (chip->tested.read == BAD) ||
42 (chip->tested.erase == BAD) ||
Alan Greend5542822019-07-30 13:28:26 +100043 (chip->tested.write == BAD)) {
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100044 msg_cinfo("This flash part has status NOT WORKING for operations:");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100045 if (chip->tested.probe == BAD)
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100046 msg_cinfo(" PROBE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100047 if (chip->tested.read == BAD)
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100048 msg_cinfo(" READ");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100049 if (chip->tested.erase == BAD)
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100050 msg_cinfo(" ERASE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100051 if (chip->tested.write == BAD)
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100052 msg_cinfo(" WRITE");
53 msg_cinfo("\n");
Edward O'Callaghan83c77002019-06-04 15:56:19 +100054 }
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100055 if ((chip->tested.probe == NT) ||
56 (chip->tested.read == NT) ||
57 (chip->tested.erase == NT) ||
Alan Greend5542822019-07-30 13:28:26 +100058 (chip->tested.write == NT)) {
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100059 msg_cinfo("This flash part has status UNTESTED for operations:");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100060 if (chip->tested.probe == NT)
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100061 msg_cinfo(" PROBE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100062 if (chip->tested.read == NT)
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100063 msg_cinfo(" READ");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100064 if (chip->tested.erase == NT)
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100065 msg_cinfo(" ERASE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100066 if (chip->tested.write == NT)
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100067 msg_cinfo(" WRITE");
68 msg_cinfo("\n");
Edward O'Callaghan83c77002019-06-04 15:56:19 +100069 }
Edward O'Callaghan84f9bb02019-09-06 13:49:06 +100070 msg_cinfo("The test status of this chip may have been updated in the latest development\n"
71 "version of flashrom. If you are running the latest development version,\n"
72 "please email a report to flashrom@flashrom.org if any of the above operations\n"
73 "work correctly for you with this flash chip. Please include the flashrom log\n"
74 "file for all operations you tested (see the man page for details), and mention\n"
75 "which mainboard or programmer you tested in the subject line.\n"
76 "Thanks for your help!\n");
Edward O'Callaghan83c77002019-06-04 15:56:19 +100077 }
78}