blob: e350293ce9e74bae52d024bc168898358b2e4e18 [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) ||
35 (chip->tested.write != OK) ||
36 (chip->tested.uread != OK)) {
Edward O'Callaghan83c77002019-06-04 15:56:19 +100037 msg_cdbg("===\n");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100038 if ((chip->tested.probe == BAD) ||
39 (chip->tested.read == BAD) ||
40 (chip->tested.erase == BAD) ||
41 (chip->tested.write == BAD) ||
42 (chip->tested.uread == BAD)) {
Edward O'Callaghan83c77002019-06-04 15:56:19 +100043 msg_cdbg("This flash part has status NOT WORKING for operations:");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100044 if (chip->tested.probe == BAD)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100045 msg_cdbg(" PROBE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100046 if (chip->tested.read == BAD)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100047 msg_cdbg(" READ");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100048 if (chip->tested.erase == BAD)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100049 msg_cdbg(" ERASE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100050 if (chip->tested.write == BAD)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100051 msg_cdbg(" WRITE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100052 if (chip->tested.uread == BAD)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100053 msg_cdbg(" UNBOUNDED READ");
54 msg_cdbg("\n");
55 }
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100056 if ((chip->tested.probe == NT) ||
57 (chip->tested.read == NT) ||
58 (chip->tested.erase == NT) ||
59 (chip->tested.write == NT) ||
60 (chip->tested.uread == NT)) {
Edward O'Callaghan83c77002019-06-04 15:56:19 +100061 msg_cdbg("This flash part has status UNTESTED for operations:");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100062 if (chip->tested.probe == NT)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100063 msg_cdbg(" PROBE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100064 if (chip->tested.read == NT)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100065 msg_cdbg(" READ");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100066 if (chip->tested.erase == NT)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100067 msg_cdbg(" ERASE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100068 if (chip->tested.write == NT)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100069 msg_cdbg(" WRITE");
Edward O'Callaghan71e30b42019-06-04 16:16:13 +100070 if (chip->tested.uread == NT)
Edward O'Callaghan83c77002019-06-04 15:56:19 +100071 msg_cdbg(" UNBOUNDED READ");
72 msg_cdbg("\n");
73 }
74 /* FIXME: This message is designed towards CLI users. */
75 msg_cdbg("The test status of this chip may have been updated "
76 "in the latest development\n"
77 "version of flashrom. If you are running the latest "
78 "development version,\n"
79 "please email a report to flashrom@flashrom.org if "
80 "any of the above operations\n"
81 "work correctly for you with this flash part. Please "
82 "include the flashrom\n"
83 "output with the additional -V option for all "
84 "operations you tested (-V, -Vr,\n"
85 "-VE, -Vw), and mention which mainboard or "
86 "programmer you tested.\n"
87 "Please mention your board in the subject line. "
88 "Thanks for your help!\n");
89 }
90}