blob: 4ed47382d1d1e0c0d4aa1b7522ecfac70dc7f88b [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'Callaghan83c77002019-06-04 15:56:19 +100026 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'Callaghan71e30b42019-06-04 16:16:13 +100032 if ((chip->tested.probe != OK) ||
33 (chip->tested.read != OK) ||
34 (chip->tested.erase != OK) ||
Alan Greend5542822019-07-30 13:28:26 +100035 (chip->tested.write != OK)) {
Edward O'Callaghan83c77002019-06-04 15:56:19 +100036 msg_cdbg("===\n");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100037 if ((chip->tested.probe == BAD) ||
38 (chip->tested.read == BAD) ||
39 (chip->tested.erase == BAD) ||
Alan Greend5542822019-07-30 13:28:26 +100040 (chip->tested.write == BAD)) {
Edward O'Callaghan83c77002019-06-04 15:56:19 +100041 msg_cdbg("This flash part has status NOT WORKING for operations:");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100042 if (chip->tested.probe == BAD)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100043 msg_cdbg(" PROBE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100044 if (chip->tested.read == BAD)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100045 msg_cdbg(" READ");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100046 if (chip->tested.erase == BAD)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100047 msg_cdbg(" ERASE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100048 if (chip->tested.write == BAD)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100049 msg_cdbg(" WRITE");
Edward O'Callaghan83c77002019-06-04 15:56:19 +100050 msg_cdbg("\n");
51 }
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100052 if ((chip->tested.probe == NT) ||
53 (chip->tested.read == NT) ||
54 (chip->tested.erase == NT) ||
Alan Greend5542822019-07-30 13:28:26 +100055 (chip->tested.write == NT)) {
Edward O'Callaghan83c77002019-06-04 15:56:19 +100056 msg_cdbg("This flash part has status UNTESTED for operations:");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100057 if (chip->tested.probe == NT)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100058 msg_cdbg(" PROBE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100059 if (chip->tested.read == NT)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100060 msg_cdbg(" READ");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100061 if (chip->tested.erase == NT)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100062 msg_cdbg(" ERASE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100063 if (chip->tested.write == NT)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100064 msg_cdbg(" WRITE");
Edward O'Callaghan83c77002019-06-04 15:56:19 +100065 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}