.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * LPDDR flash memory device operations. This module provides read, write, |
---|
3 | 4 | * erase, lock/unlock support for LPDDR flash memories |
---|
.. | .. |
---|
5 | 6 | * (C) 2008 Vasiliy Leonenko <vasiliy.leonenko@gmail.com> |
---|
6 | 7 | * Many thanks to Roman Borisov for initial enabling |
---|
7 | 8 | * |
---|
8 | | - * This program is free software; you can redistribute it and/or |
---|
9 | | - * modify it under the terms of the GNU General Public License |
---|
10 | | - * as published by the Free Software Foundation; either version 2 |
---|
11 | | - * of the License, or (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 Street, Fifth Floor, Boston, MA |
---|
21 | | - * 02110-1301, USA. |
---|
22 | 9 | * TODO: |
---|
23 | 10 | * Implement VPP management |
---|
24 | 11 | * Implement XIP support |
---|
.. | .. |
---|
106 | 93 | return mtd; |
---|
107 | 94 | } |
---|
108 | 95 | EXPORT_SYMBOL(lpddr_cmdset); |
---|
| 96 | + |
---|
| 97 | +static void print_drs_error(unsigned int dsr) |
---|
| 98 | +{ |
---|
| 99 | + int prog_status = (dsr & DSR_RPS) >> 8; |
---|
| 100 | + |
---|
| 101 | + if (!(dsr & DSR_AVAILABLE)) |
---|
| 102 | + pr_notice("DSR.15: (0) Device not Available\n"); |
---|
| 103 | + if ((prog_status & 0x03) == 0x03) |
---|
| 104 | + pr_notice("DSR.9,8: (11) Attempt to program invalid half with 41h command\n"); |
---|
| 105 | + else if (prog_status & 0x02) |
---|
| 106 | + pr_notice("DSR.9,8: (10) Object Mode Program attempt in region with Control Mode data\n"); |
---|
| 107 | + else if (prog_status & 0x01) |
---|
| 108 | + pr_notice("DSR.9,8: (01) Program attempt in region with Object Mode data\n"); |
---|
| 109 | + if (!(dsr & DSR_READY_STATUS)) |
---|
| 110 | + pr_notice("DSR.7: (0) Device is Busy\n"); |
---|
| 111 | + if (dsr & DSR_ESS) |
---|
| 112 | + pr_notice("DSR.6: (1) Erase Suspended\n"); |
---|
| 113 | + if (dsr & DSR_ERASE_STATUS) |
---|
| 114 | + pr_notice("DSR.5: (1) Erase/Blank check error\n"); |
---|
| 115 | + if (dsr & DSR_PROGRAM_STATUS) |
---|
| 116 | + pr_notice("DSR.4: (1) Program Error\n"); |
---|
| 117 | + if (dsr & DSR_VPPS) |
---|
| 118 | + pr_notice("DSR.3: (1) Vpp low detect, operation aborted\n"); |
---|
| 119 | + if (dsr & DSR_PSS) |
---|
| 120 | + pr_notice("DSR.2: (1) Program suspended\n"); |
---|
| 121 | + if (dsr & DSR_DPS) |
---|
| 122 | + pr_notice("DSR.1: (1) Aborted Erase/Program attempt on locked block\n"); |
---|
| 123 | +} |
---|
109 | 124 | |
---|
110 | 125 | static int wait_for_ready(struct map_info *map, struct flchip *chip, |
---|
111 | 126 | unsigned int chip_op_time) |
---|
.. | .. |
---|
317 | 332 | /* Only if there's no operation suspended... */ |
---|
318 | 333 | if (mode == FL_READY && chip->oldstate == FL_READY) |
---|
319 | 334 | return 0; |
---|
320 | | - |
---|
| 335 | + fallthrough; |
---|
321 | 336 | default: |
---|
322 | 337 | sleep: |
---|
323 | 338 | set_current_state(TASK_UNINTERRUPTIBLE); |
---|