soc/intel/alderlake: Add ADL-P 4+4 with 28W TDP
[coreboot.git] / src / device / oprom / yabel / debug.c
blobfc226fe6afd7ffa810ec18ca61af907862b7528a
1 /******************************************************************************
2 * Copyright (c) 2004, 2008 IBM Corporation
3 * Copyright (c) 2008, 2009 Pattrick Hueper <phueper@hueper.net>
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
11 * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer
16 * in the documentation and/or other materials provided with the
17 * distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * Contributors:
32 * IBM Corporation - initial implementation
33 *****************************************************************************/
35 #include "debug.h"
37 u32 debug_flags = 0;
39 void
40 dump(u8 *addr, u32 len)
42 printf("\n%s(%p, %x):\n", __func__, addr, len);
43 while (len) {
44 unsigned int tmpCnt = len;
45 unsigned char x;
46 if (tmpCnt > 8)
47 tmpCnt = 8;
48 printf("\n%p: ", addr);
49 // print hex
50 while (tmpCnt--) {
51 set_ci();
52 x = *addr++;
53 clr_ci();
54 printf("%02x ", x);
56 tmpCnt = len;
57 if (tmpCnt > 8)
58 tmpCnt = 8;
59 len -= tmpCnt;
60 //reset addr ptr to print ascii
61 addr = addr - tmpCnt;
62 // print ascii
63 while (tmpCnt--) {
64 set_ci();
65 x = *addr++;
66 clr_ci();
67 if ((x < 32) || (x >= 127)) {
68 //non-printable char
69 x = '.';
71 printf("%c", x);
74 printf("\n");