Stefan Reinauer | 49428d8 | 2013-02-21 15:48:37 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 Google Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #include "i915_reg.h" |
| 21 | |
| 22 | /* One-letter commands for code not meant to be ready for humans. |
| 23 | * The code was generated by a set of programs/scripts. |
| 24 | * M print out a kernel message |
| 25 | * R read a register. We do these mainly to ensure that if hardware wanted |
| 26 | * the register read, it was read; also, in debug, we can see what was expected |
| 27 | * and what was found. This has proven *very* useful to get this debugged. |
| 28 | * The udelay, if non-zero, will make sure there is a |
| 29 | * udelay() call with the value. |
| 30 | * The count is from the kernel and tells us how many times this read was done. |
| 31 | * Also useful for debugging and the state |
| 32 | * machine uses the info to drive a poll. |
| 33 | * W Write a register |
| 34 | * V set verbosity. It's a bit mask. |
| 35 | * 0 -> nothing |
| 36 | * 1 -> print kernel messages |
| 37 | * 2 -> print IO ops |
| 38 | * 4 -> print the number of times we spin on a register in a poll |
| 39 | * 8 -> restore whatever the previous verbosity level was |
| 40 | * (only one deep stack) |
| 41 | * |
| 42 | * Again, this is not really meant for human consumption. There is not a poll |
| 43 | * operator as such because, sometimes, there is a read/write/read where the |
| 44 | * second read is a poll, and this chipset is so touchy I'm reluctant to move |
| 45 | * things around and/or delete too many reads. |
| 46 | */ |
| 47 | #define M 1 |
| 48 | #define R 2 |
| 49 | #define W 3 |
| 50 | #define V 4 |
| 51 | #define I 8 |
| 52 | |
| 53 | struct iodef { |
| 54 | unsigned char op; |
| 55 | unsigned int count; |
| 56 | const char *msg; |
| 57 | unsigned long addr; |
| 58 | unsigned long data; |
| 59 | unsigned long udelay; |
| 60 | }; |