Vikram Narayanan (vikram186(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/912
-gerrit
commit c758288c0fc5ea96e0a56645e13dce71f5240f92
Author: Vikram Narayanan <vikram186(a)gmail.com>
Date: Sat Apr 21 23:47:56 2012 +0530
cbtypes.h: Unify cbtypes.h used in AMD board's code
Remove all the repeated sections of code in cbtypes.h and place it
in a common location. Add include dir in vendor code's Makefile.
Change-Id: Ida92c2a7a88e9520b84b0dcbbf37cd5c9f63f798
Signed-off-by: Vikram Narayanan <vikram186(a)gmail.com>
---
src/include/cpu/amd/common/cbtypes.h | 68 +++++++++++++++++++++++++
src/mainboard/amd/torpedo/gpio.h | 2 +-
src/northbridge/amd/cimx/rd890/NbPlatform.h | 2 +-
src/northbridge/amd/cimx/rd890/amd.h | 3 +-
src/northbridge/amd/cimx/rd890/cbtypes.h | 71 ---------------------------
src/southbridge/amd/cimx/sb700/Platform.h | 2 +-
src/southbridge/amd/cimx/sb700/cbtypes.h | 53 --------------------
src/southbridge/amd/cimx/sb800/cbtypes.h | 53 --------------------
src/southbridge/amd/cimx/sb900/cbtypes.h | 59 ----------------------
src/vendorcode/amd/cimx/rd890/Makefile.inc | 1 +
src/vendorcode/amd/cimx/sb700/Makefile.inc | 1 +
src/vendorcode/amd/cimx/sb800/Makefile.inc | 1 +
src/vendorcode/amd/cimx/sb900/Makefile.inc | 1 +
13 files changed, 76 insertions(+), 241 deletions(-)
diff --git a/src/include/cpu/amd/common/cbtypes.h b/src/include/cpu/amd/common/cbtypes.h
new file mode 100644
index 0000000..4aed025
--- /dev/null
+++ b/src/include/cpu/amd/common/cbtypes.h
@@ -0,0 +1,68 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _CBTYPES_H_
+#define _CBTYPES_H_
+
+//#include <stdint.h>
+
+typedef signed long long __int64;
+typedef void VOID;
+typedef unsigned int UINTN;
+typedef signed char CHAR8;
+typedef unsigned char UINT8;
+typedef unsigned short UINT16;
+typedef unsigned int UINT32;
+typedef signed int INT32;
+typedef unsigned long long UINT64;
+typedef unsigned char BOOLEAN;
+
+#define DMSG_SB_TRACE 0x02
+#define TRACE(Arguments)
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef VOLATILE
+#define VOLATILE volatile
+#endif
+#ifndef CONST
+#define CONST const
+#endif
+
+#ifndef IN
+#define IN
+#endif
+#ifndef OUT
+#define OUT
+#endif
+
+
+#ifndef STATIC
+#define STATIC static
+#endif
+#ifndef VOLATILE
+#define VOLATILE volatile
+#endif
+
+#endif
diff --git a/src/mainboard/amd/torpedo/gpio.h b/src/mainboard/amd/torpedo/gpio.h
index 45394ef..a33323e 100644
--- a/src/mainboard/amd/torpedo/gpio.h
+++ b/src/mainboard/amd/torpedo/gpio.h
@@ -27,7 +27,7 @@
#define _GPIO_H_
#include <stdint.h>
-#include <cbtypes.h>
+#include <cpu/amd/common/cbtypes.h>
/*----------------------------------------------------------------------------------------
* D E F I N I T I O N S A N D M A C R O S
diff --git a/src/northbridge/amd/cimx/rd890/NbPlatform.h b/src/northbridge/amd/cimx/rd890/NbPlatform.h
index 824057a..629e810 100644
--- a/src/northbridge/amd/cimx/rd890/NbPlatform.h
+++ b/src/northbridge/amd/cimx/rd890/NbPlatform.h
@@ -94,7 +94,7 @@
#define CIMX_S3_SAVE 1
-#include "cbtypes.h"
+#include <cpu/amd/common/cbtypes.h>
#include <console/console.h>
#include "amd.h" //cimx typedef
diff --git a/src/northbridge/amd/cimx/rd890/amd.h b/src/northbridge/amd/cimx/rd890/amd.h
index d99f90f..3e2e78f 100644
--- a/src/northbridge/amd/cimx/rd890/amd.h
+++ b/src/northbridge/amd/cimx/rd890/amd.h
@@ -20,8 +20,7 @@
#ifndef _AMD_H_
#define _AMD_H_
-#include "cbtypes.h"
-
+#include <cpu/amd/common/cbtypes.h>
#define VOLATILE volatile
#define CALLCONV
diff --git a/src/northbridge/amd/cimx/rd890/cbtypes.h b/src/northbridge/amd/cimx/rd890/cbtypes.h
deleted file mode 100644
index ade55d7..0000000
--- a/src/northbridge/amd/cimx/rd890/cbtypes.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2010 - 2012 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CBTYPES_H_
-#define _CBTYPES_H_
-
-//#include <stdint.h>
-
-/*
-typedef int64_t __int64;
-typedef void VOID;
-typedef uint32_t UINTN;//
-typedef int8_t CHAR8;
-typedef uint8_t UINT8;
-typedef uint16_t UINT16;
-typedef uint32_t UINT32;
-typedef uint64_t UINT64;
-*/
-typedef signed long long __int64;
-typedef void VOID;
-typedef unsigned int UINTN;//
-typedef signed char CHAR8;
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef signed int INT32;
-typedef unsigned long long UINT64;
-
-#define TRUE 1
-#define FALSE 0
-typedef unsigned char BOOLEAN;
-
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-
-#ifndef IN
-#define IN
-#endif
-#ifndef OUT
-#define OUT
-#endif
-
-//porting.h
-#ifndef CONST
-#define CONST const
-#endif
-#ifndef STATIC
-#define STATIC static
-#endif
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-
-#endif
diff --git a/src/southbridge/amd/cimx/sb700/Platform.h b/src/southbridge/amd/cimx/sb700/Platform.h
index 15e5b07..d70345d 100644
--- a/src/southbridge/amd/cimx/sb700/Platform.h
+++ b/src/southbridge/amd/cimx/sb700/Platform.h
@@ -22,7 +22,7 @@
#pragma pack(push,1)
-#include "cbtypes.h"
+#include <cpu/amd/common/cbtypes.h>
#include <console/console.h>
#include <console/loglevel.h>
#ifdef NULL
diff --git a/src/southbridge/amd/cimx/sb700/cbtypes.h b/src/southbridge/amd/cimx/sb700/cbtypes.h
deleted file mode 100644
index d37e1e3..0000000
--- a/src/southbridge/amd/cimx/sb700/cbtypes.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CBTYPES_H_
-#define _CBTYPES_H_
-
-//#include <stdint.h>
-
-typedef signed long long __int64;
-typedef void VOID;
-typedef unsigned int UINTN;
-typedef signed char CHAR8;
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-typedef unsigned char BOOLEAN;
-
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-
-#ifndef IN
-#define IN
-#endif
-#ifndef OUT
-#define OUT
-#endif
-
-#endif
diff --git a/src/southbridge/amd/cimx/sb800/cbtypes.h b/src/southbridge/amd/cimx/sb800/cbtypes.h
deleted file mode 100644
index 03a0854..0000000
--- a/src/southbridge/amd/cimx/sb800/cbtypes.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CBTYPES_H_
-#define _CBTYPES_H_
-
-//#include <stdint.h>
-
-typedef signed long long __int64;
-typedef void VOID;
-typedef unsigned int UINTN;
-typedef signed char CHAR8;
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-typedef unsigned char BOOLEAN;
-
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-
-#ifndef IN
-#define IN
-#endif
-#ifndef OUT
-#define OUT
-#endif
-
-#endif
diff --git a/src/southbridge/amd/cimx/sb900/cbtypes.h b/src/southbridge/amd/cimx/sb900/cbtypes.h
deleted file mode 100644
index 4c97a33..0000000
--- a/src/southbridge/amd/cimx/sb900/cbtypes.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CBTYPES_H_
-#define _CBTYPES_H_
-
-//#include <stdint.h>
-
-typedef signed long long __int64;
-typedef void VOID;
-typedef unsigned int UINTN;
-typedef signed char CHAR8;
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-typedef unsigned char BOOLEAN;
-
-#define DMSG_SB_TRACE 0x02
-#define TRACE(Arguments)
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-#ifndef CONST
-#define CONST const
-#endif
-
-#ifndef IN
-#define IN
-#endif
-#ifndef OUT
-#define OUT
-#endif
-
-#endif
diff --git a/src/vendorcode/amd/cimx/rd890/Makefile.inc b/src/vendorcode/amd/cimx/rd890/Makefile.inc
index 8a05570..feeb2cd 100644
--- a/src/vendorcode/amd/cimx/rd890/Makefile.inc
+++ b/src/vendorcode/amd/cimx/rd890/Makefile.inc
@@ -32,6 +32,7 @@ CIMX_ROOT = $(src)/vendorcode/amd/cimx
NB_CIMX_INC = -I$(src)/mainboard/$(MAINBOARDDIR)
NB_CIMX_INC += -I$(src)/northbridge/amd/cimx/rd890
+NB_CIMX_INC += -I$(src)/include/cpu/amd/common
NB_CIMX_INC += -I$(CIMX_ROOT)/rd890
romstage-y += amdAcpiIvrs.c
diff --git a/src/vendorcode/amd/cimx/sb700/Makefile.inc b/src/vendorcode/amd/cimx/sb700/Makefile.inc
index 8954133..10d03e6 100644
--- a/src/vendorcode/amd/cimx/sb700/Makefile.inc
+++ b/src/vendorcode/amd/cimx/sb700/Makefile.inc
@@ -32,6 +32,7 @@ CIMX_ROOT = $(src)/vendorcode/amd/cimx
SB_CIMX_INC = -I$(src)/mainboard/$(MAINBOARDDIR)
SB_CIMX_INC += -I$(src)/southbridge/amd/cimx/sb700
+SB_CIMX_INC += -I$(src)/include/cpu/amd/common
SB_CIMX_INC += -I$(CIMX_ROOT)/sb700
romstage-y += ACPILIB.c
diff --git a/src/vendorcode/amd/cimx/sb800/Makefile.inc b/src/vendorcode/amd/cimx/sb800/Makefile.inc
index 7badca5..00ba471 100644
--- a/src/vendorcode/amd/cimx/sb800/Makefile.inc
+++ b/src/vendorcode/amd/cimx/sb800/Makefile.inc
@@ -22,6 +22,7 @@ CIMX_ROOT = $(src)/vendorcode/amd/cimx
CIMX_INC = -I$(src)/mainboard/$(MAINBOARDDIR)
CIMX_INC += -I$(src)/southbridge/amd/cimx/sb800
+CIMX_INC += -I$(src)/include/cpu/amd/common
CIMX_INC += -I$(CIMX_ROOT)/sb800
romstage-y += ACPILIB.c
diff --git a/src/vendorcode/amd/cimx/sb900/Makefile.inc b/src/vendorcode/amd/cimx/sb900/Makefile.inc
index 76b610f..e29bdc9 100755
--- a/src/vendorcode/amd/cimx/sb900/Makefile.inc
+++ b/src/vendorcode/amd/cimx/sb900/Makefile.inc
@@ -22,6 +22,7 @@ CIMX_ROOT = $(src)/vendorcode/amd/cimx
CIMX_INC = -I$(src)/mainboard/$(MAINBOARDDIR)
CIMX_INC += -I$(src)/southbridge/amd/cimx/sb900
+CIMX_INC += -I$(src)/include/cpu/amd/common
CIMX_INC += -I$(CIMX_ROOT)/sb900
romstage-y += AcpiLib.c
Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/914
-gerrit
commit a40d82ec4f63fa0e06f16cf94d433af81ceb71ab
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat Apr 21 21:11:52 2012 +0200
Drop build_opt_tbl
It's gone from the build. Drop the code as well.
Change-Id: Ice6fcb39565273360a576bda4826f16088f4666c
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
util/options/build_opt_tbl.c | 684 ------------------------------------------
1 files changed, 0 insertions(+), 684 deletions(-)
diff --git a/util/options/build_opt_tbl.c b/util/options/build_opt_tbl.c
deleted file mode 100644
index b89bb4f..0000000
--- a/util/options/build_opt_tbl.c
+++ /dev/null
@@ -1,684 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2003 Eric Biederman (ebiederm(a)xmission.com)
- * Copyright (C) 2007-2010 coresystems GmbH
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <errno.h>
-#include <libgen.h>
-#define UTIL_BUILD_OPTION_TABLE
-#include "../../src/include/pc80/mc146818rtc.h"
-#include "../../src/include/boot/coreboot_tables.h"
-
-#define CMOS_IMAGE_BUFFER_SIZE 256
-#define INPUT_LINE_MAX 256
-#define MAX_VALUE_BYTE_LENGTH 64
-
-#define TMPFILE_LEN 25600
-#define TMPFILE_TEMPLATE "/build_opt_tbl_XXXXXX"
-
-static unsigned char cmos_table[4096];
-
-/* This array is used to isolate bits that are to be changed in a byte */
-static unsigned char clip[9]={0,1,3,7,0x0f,0x1f,0x3f,0x7f,0xff};
-
-#ifdef WIN32
-#include <fcntl.h>
-char *mkstemp(char* name)
-{
- static char val='0';
- char *c=name;
- while (*c!='X') c++;
- *c=val++;
- return open(name,O_CREAT | O_RDWR);
-}
-#define UNLINK_IF_NECESSARY(x) unlink(x)
-#else
-#define UNLINK_IF_NECESSARY(x)
-#endif
-
-/**
- * This routine loops through the entried and tests if any of the fields
- * overlap.
- * If there is an overlap, the routine exits, otherwise it returns.
- *
- * @param entry_start memory pointer to the start of the entries.
- * @param entry_end memory pointer to the byte past the entries.
- */
-static void test_for_entry_overlaps(void *entry_start, void *entry_end)
-{
- int ptr;
- char *cptr;
- int buffer_bit_size;
- int offset;
- int byte;
- int byte_length;
- struct cmos_entries *ce;
- unsigned char test[CMOS_IMAGE_BUFFER_SIZE];
- unsigned char set;
-
- /* calculate the size of the cmos buffer in bits */
- buffer_bit_size=(CMOS_IMAGE_BUFFER_SIZE*8);
- /* clear the temporary test buffer */
- for(ptr=0; ptr < CMOS_IMAGE_BUFFER_SIZE; ptr++)
- test[ptr]=0;
-
- /* loop through each entry in the table testing for errors */
- for(cptr = entry_start; cptr < (char *)entry_end; cptr += ce->size) {
- ce=(struct cmos_entries *)cptr;
- /* test if entry goes past the end of the buffer */
- if((int)(ce->bit+ce->length) > buffer_bit_size) {
- printf("Error - Entry %s start bit + length must be less than %d\n",
- ce->name,buffer_bit_size);
- exit(1);
- }
- byte=ce->bit/8;
- offset=ce->bit%8;
- byte_length=ce->length/8;
- if(byte_length) { /* entry is 8 bits long or more */
- if(offset) { /* if 8 bits or more long, it must be byte aligned */
- printf("Error - Entry %s length over 8 must be byte aligned\n",
- ce->name);
- exit(1);
- }
- /* test if entries 8 or more in length are even bytes */
- if(ce->length%8){
- printf("Error - Entry %s length over 8 must be a multiple of 8\n",
- ce->name);
- exit(1);
- }
- /* test if any of the bits have been previously used */
- for(;byte_length;byte_length--,byte++) {
- if(test[byte]) {
- printf("Error - Entry %s uses same bits previously used\n",
- ce->name);
- exit(1);
- }
- test[byte]=clip[8]; /* set the bits defined in test */
- }
- } else {
- /* test if bits overlap byte boundaries */
- if((int)ce->length > (8-offset)) {
- printf("Error - Entry %s length overlaps a byte boundry\n",
- ce->name);
- exit(1);
- }
- /* test for bits previously used */
- set=(clip[ce->length]<<offset);
- if(test[byte]&set) {
- printf("Error - Entry %s uses same bits previously used\n",
- ce->name);
- exit(1);
- }
- test[byte]|=set; /* set the bits defined in test */
- }
- }
- return;
-}
-
-/* This routine displays the usage options */
-static void display_usage(char *name)
-{
- printf("Usage: %s [--config filename]\n", name);
- printf(" [--option filename]\n");
- printf(" [--header filename]\n\n");
- printf("--config = Build the definitions table from the given file.\n");
- printf("--binary = Output a binary file with the definitions.\n");
- printf("--option = Output a C source file with the definitions.\n");
- printf("--header = Output a C header file with the definitions.\n");
- exit(1);
-}
-
-static void skip_spaces(char *line, char **ptr)
-{
- if (!isspace(**ptr)) {
- printf("Error missing whitespace in line\n%s\n", line);
- exit(1);
- }
- while(isspace(**ptr)) {
- (*ptr)++;
- }
- return;
-}
-
-static unsigned long get_number(char *line, char **ptr, int base)
-{
- unsigned long value;
- char *ptr2;
- value = strtoul(*ptr, &ptr2, base);
- if (ptr2 == *ptr) {
- printf("Error missing digits at: \n%s\n in line:\n%s\n",
- *ptr, line);
- exit(1);
- }
- *ptr = ptr2;
- return value;
-}
-
-static int is_ident_digit(int c)
-{
- int result;
- switch(c) {
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- case '8': case '9':
- result = 1;
- break;
- default:
- result = 0;
- break;
- }
- return result;
-}
-
-static int is_ident_nondigit(int c)
-{
- int result;
- switch(c) {
- case 'A': case 'B': case 'C': case 'D':
- case 'E': case 'F': case 'G': case 'H':
- case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P':
- case 'Q': case 'R': case 'S': case 'T':
- case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- case 'a': case 'b': case 'c': case 'd':
- case 'e': case 'f': case 'g': case 'h':
- case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p':
- case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- case '_':
- result = 1;
- break;
- default:
- result = 0;
- break;
- }
- return result;
-}
-
-static int is_ident(char *str)
-{
- int result;
- int ch;
- ch = *str;
- result = 0;
- if (is_ident_nondigit(ch)) {
- do {
- str++;
- ch = *str;
- } while(ch && (is_ident_nondigit(ch) || (is_ident_digit(ch))));
- result = (ch == '\0');
- }
- return result;
-}
-
-/**
- * This routine builds the cmos definition table from the cmos layout file
- *
- * The input comes from the configuration file which contains two parts
- * entries and enumerations. Each section is started with the key words
- * entries and enumerations. Records then follow in their respective
- * formats.
- *
- * The output of this program is the cmos definitions table. It is stored
- * in the cmos_table array. If this module is called, and the global
- * table_file has been implimented by the user, the table is also written
- * to the specified file.
- *
- * This program exits with a return code of 1 on error. It returns 0 on
- * successful completion
- */
-int main(int argc, char **argv)
-{
- int i;
- char *config=0;
- char *binary=0;
- char *option=0;
- char *header=0;
- FILE *fp;
- int tempfile;
- char tempfilename[TMPFILE_LEN];
- struct cmos_option_table *ct;
- struct cmos_entries *ce;
- struct cmos_enums *c_enums, *c_enums_start;
- struct cmos_checksum *cs, *new_cs;
- char line[INPUT_LINE_MAX];
- unsigned char uc;
- int entry_mode=0;
- int enum_mode=0;
- int checksum_mode=0;
- int cnt;
- char *cptr;
- void *entry_start, *entry_end;
- int entries_length;
- int enum_length;
- int len;
- char buf[16];
- char val;
-
- for(i=1;i<argc;i++) {
- if(argv[i][0]!='-') {
- display_usage(argv[0]);
- }
- switch(argv[i][1]) {
- case '-': /* data is requested from a file */
- switch(argv[i][2]) {
- case 'c': /* use a configuration file */
- if(strcmp(&argv[i][2],"config")) {
- display_usage(argv[0]);
- }
- config=argv[++i];
- break;
- case 'b': /* Emit a binary file */
- if(strcmp(&argv[i][2],"binary")) {
- display_usage(argv[0]);
- }
- binary=argv[++i];
- break;
- case 'o': /* use a cmos definitions table file */
- if(strcmp(&argv[i][2],"option")) {
- display_usage(argv[0]);
- }
- option=argv[++i];
- break;
- case 'h': /* Output a header file */
- if (strcmp(&argv[i][2], "header") != 0) {
- display_usage(argv[0]);
- }
- header=argv[++i];
- break;
- default:
- display_usage(argv[0]);
- break;
- }
- break;
-
- default:
- display_usage(argv[0]);
- break;
- }
- }
-
-
- /* Has the user specified a configuration file */
- if(config) { /* if yes, open it */
- if((fp=fopen(config,"r"))==NULL){
- fprintf(stderr, "Error - Can not open config file %s\n",config);
- exit(1); /* exit if it can not be opened */
- }
- }
- else { /* no configuration file specified, so try the default */
- if((fp=fopen("cmos.layout","r"))==NULL){
- fprintf(stderr, "Error - Can not open cmos.layout\n");
- exit(1); /* end of no configuration file is found */
- }
- }
- /* type cast a pointer, so we can us the structure */
- ct=(struct cmos_option_table*)cmos_table;
- /* start the table with the type signature */
- ct->tag = LB_TAG_CMOS_OPTION_TABLE;
- /* put in the header length */
- ct->header_length=sizeof(*ct);
-
- /* Get the entry records */
- ce=(struct cmos_entries*)(cmos_table+(ct->header_length));
- cptr = (char*)ce;
- for(;;){ /* this section loops through the entry records */
- if(fgets(line,INPUT_LINE_MAX,fp)==NULL)
- break; /* end if no more input */
- // FIXME mode should be a single enum.
- if(!entry_mode) { /* skip input until the entries key word */
- if (strstr(line,"entries") != 0) {
- entry_mode=1;
- enum_mode=0;
- checksum_mode=0;
- continue;
- }
- } else { /* Test if we are done with entries and starting enumerations */
- if (strstr(line,"enumerations") != 0){
- entry_mode=0;
- enum_mode=1;
- checksum_mode=0;
- break;
- }
- if (strstr(line, "checksums") != 0) {
- entry_mode=0;
- enum_mode=0;
- checksum_mode=1;
- break;
- }
- }
-
- /* skip commented and blank lines */
- val = line[strspn(line," ")];
- /* takes care of *nix, Mac and Windows line ending formats */
- if (val=='#' || val=='\n' || val=='\r') continue;
- /* scan in the input data */
- sscanf(line,"%d %d %c %d %s",
- &ce->bit,&ce->length,&uc,&ce->config_id,&ce->name[0]);
- ce->config=(int)uc;
- /* check bit and length ranges */
- if(ce->bit>(CMOS_IMAGE_BUFFER_SIZE*8)) {
- fprintf(stderr, "Error - bit is to big in line \n%s\n",line);
- exit(1);
- }
- if((ce->length>(MAX_VALUE_BYTE_LENGTH*8))&&(uc!='r')) {
- fprintf(stderr, "Error - Length is to long in line \n%s\n",line);
- exit(1);
- }
- if (!is_ident((char *)ce->name)) {
- fprintf(stderr,
- "Error - Name %s is an invalid identifier in line\n %s\n",
- ce->name, line);
- exit(1);
- }
- /* put in the record type */
- ce->tag=LB_TAG_OPTION;
- /* calculate and save the record length */
- len=strlen((char *)ce->name)+1;
- /* make the record int aligned */
- if(len%4)
- len+=(4-(len%4));
- ce->size=sizeof(struct cmos_entries)-32+len;
- cptr = (char*)ce;
- cptr += ce->size; /* increment to the next table position */
- ce = (struct cmos_entries*) cptr;
- }
-
- /* put the length of the entries into the header section */
- entries_length = (cptr - (char *)&cmos_table) - ct->header_length;
-
- /* compute the start of the enumerations section */
- entry_start = ((char*)&cmos_table) + ct->header_length;
- entry_end = ((char *)entry_start) + entries_length;
- c_enums_start = c_enums = (struct cmos_enums*)entry_end;
- /* test for overlaps in the entry records */
- test_for_entry_overlaps(entry_start, entry_end);
-
- for(;enum_mode;){ /* loop to build the enumerations section */
- long ptr;
- if(fgets(line,INPUT_LINE_MAX,fp)==NULL)
- break; /* go till end of input */
-
- if (strstr(line, "checksums") != 0) {
- enum_mode=0;
- checksum_mode=1;
- break;
- }
-
- /* skip commented and blank lines */
- if(line[0]=='#') continue;
- if(line[strspn(line," ")]=='\n') continue;
-
- /* scan in the data */
- for(ptr=0;(line[ptr]==' ')||(line[ptr]=='\t');ptr++);
- c_enums->config_id=strtol(&line[ptr],(char**)NULL,10);
- for(;(line[ptr]!=' ')&&(line[ptr]!='\t');ptr++);
- for(;(line[ptr]==' ')||(line[ptr]=='\t');ptr++);
- c_enums->value=strtol(&line[ptr],(char**)NULL,10);
- for(;(line[ptr]!=' ')&&(line[ptr]!='\t');ptr++);
- for(;(line[ptr]==' ')||(line[ptr]=='\t');ptr++);
- for(cnt=0;(line[ptr]!='\n')&&(cnt<31);ptr++,cnt++)
- c_enums->text[cnt]=line[ptr];
- c_enums->text[cnt]=0;
-
- /* make the record int aligned */
- cnt++;
- if(cnt%4)
- cnt+=4-(cnt%4);
- /* store the record length */
- c_enums->size=((char *)&c_enums->text[cnt]) - (char *)c_enums;
- /* store the record type */
- c_enums->tag=LB_TAG_OPTION_ENUM;
- /* increment to the next record */
- c_enums=(struct cmos_enums*)&c_enums->text[cnt];
- }
- /* save the enumerations length */
- enum_length= (char *)c_enums - (char *)c_enums_start;
- ct->size=ct->header_length+enum_length+entries_length;
-
- /* Get the checksum records */
- new_cs = (struct cmos_checksum *)(cmos_table+(ct->size));
- for(;checksum_mode;) { /* This section finds the checksums */
- char *ptr;
- if(fgets(line, INPUT_LINE_MAX,fp)==NULL)
- break; /* end if no more input */
-
- /* skip commented and blank lines */
- if (line[0]=='#') continue;
- if (line[strspn(line, " ")]=='\n') continue;
- if (memcmp(line, "checksum", 8) != 0) continue;
-
- /* We actually found a new cmos checksum entry */
- cs = new_cs;
-
- /* get the information */
- ptr = line + 8;
- skip_spaces(line, &ptr);
- cs->range_start = get_number(line, &ptr, 10);
-
- skip_spaces(line, &ptr);
- cs->range_end = get_number(line, &ptr, 10);
-
- skip_spaces(line, &ptr);
- cs->location = get_number(line, &ptr, 10);
-
- /* Make certain there are spaces until the end of the line */
- skip_spaces(line, &ptr);
-
- if ((cs->range_start%8) != 0) {
- fprintf(stderr, "Error - range start is not byte aligned in line\n%s\n", line);
- exit(1);
- }
- if (cs->range_start >= (CMOS_IMAGE_BUFFER_SIZE*8)) {
- fprintf(stderr, "Error - range start is to big in line\n%s\n", line);
- exit(1);
- }
- if ((cs->range_end%8) != 7) {
- fprintf(stderr, "Error - range end is not byte aligned in line\n%s\n", line);
- exit(1);
- }
- if ((cs->range_end) >= (CMOS_IMAGE_BUFFER_SIZE*8)) {
- fprintf(stderr, "Error - range end is to long in line\n%s\n", line);
- exit(1);
- }
- if ((cs->location%8) != 0) {
- fprintf(stderr, "Error - location is not byte aligned in line\n%s\n", line);
- exit(1);
- }
- if ((cs->location >= (CMOS_IMAGE_BUFFER_SIZE*8)) ||
- ((cs->location + 16) > (CMOS_IMAGE_BUFFER_SIZE*8)))
- {
- fprintf(stderr, "Error - location is to big in line\n%s\n", line);
- exit(1);
- }
-
- cs->tag = LB_TAG_OPTION_CHECKSUM;
- cs->size = sizeof(*cs);
- cs->type = CHECKSUM_PCBIOS;
-
- cptr = (char *)cs;
- cptr += cs->size;
- new_cs = (struct cmos_checksum *)cptr;
- }
- ct->size += (cptr - (char *)(cmos_table + ct->size));
- fclose(fp);
-
- /* See if we want to output a C source file */
- if(option) {
- int err=0;
- snprintf(tempfilename, TMPFILE_LEN, "%s%s", dirname(strdup(option)), TMPFILE_TEMPLATE);
- tempfile = mkstemp(tempfilename);
- if(tempfile == -1) {
- perror("Error - Could not create temporary file");
- exit(1);
- }
-
- if((fp=fdopen(tempfile,"w"))==NULL){
- perror("Error - Could not open temporary file");
- unlink(tempfilename);
- exit(1);
- }
-
- /* write the header */
- if(fwrite("unsigned char option_table[] = {",1,32,fp) != 32) {
- perror("Error - Could not write image file");
- fclose(fp);
- unlink(tempfilename);
- exit(1);
- }
- /* write the array values */
- for(i=0; i<(int)(ct->size-1); i++) {
- if(!(i%10) && !err) err=(fwrite("\n\t",1,2,fp) != 2);
- sprintf(buf,"0x%02x,",cmos_table[i]);
- if(!err) err=(fwrite(buf,1,5,fp) != 5);
- }
- /* write the end */
- sprintf(buf,"0x%02x\n",cmos_table[i]);
- if(!err) err=(fwrite(buf,1,4,fp) != 4);
- if(fwrite("};\n",1,3,fp) != 3) {
- perror("Error - Could not write image file");
- fclose(fp);
- unlink(tempfilename);
- exit(1);
- }
-
- fclose(fp);
- UNLINK_IF_NECESSARY(option);
- if (rename(tempfilename, option)) {
- fprintf(stderr, "Error - Could not write %s: ", option);
- perror(NULL);
- unlink(tempfilename);
- exit(1);
- }
- }
-
- /* See if we also want to output a binary file */
- if(binary) {
- int err=0;
- snprintf(tempfilename, TMPFILE_LEN, "%s%s", dirname(strdup(binary)), TMPFILE_TEMPLATE);
- tempfile = mkstemp(tempfilename);
- if(tempfile == -1) {
- perror("Error - Could not create temporary file");
- exit(1);
- }
-
- if((fp=fdopen(tempfile,"wb"))==NULL){
- perror("Error - Could not open temporary file");
- unlink(tempfilename);
- exit(1);
- }
-
- /* write the array values */
- if(fwrite(cmos_table, (int)(ct->size-1), 1, fp) != 1) {
- perror("Error - Could not write image file");
- fclose(fp);
- unlink(tempfilename);
- exit(1);
- }
-
- fclose(fp);
- UNLINK_IF_NECESSARY(binary);
- if (rename(tempfilename, binary)) {
- fprintf(stderr, "Error - Could not write %s: ", binary);
- perror(NULL);
- unlink(tempfilename);
- exit(1);
- }
- }
-
- /* See if we also want to output a C header file */
- if (header) {
- struct cmos_option_table *hdr;
- struct lb_record *ptr, *end;
-
- snprintf(tempfilename, TMPFILE_LEN, "%s%s", dirname(strdup(header)), TMPFILE_TEMPLATE);
- tempfile = mkstemp(tempfilename);
- if(tempfile == -1) {
- perror("Error - Could not create temporary file");
- exit(1);
- }
-
- fp = fdopen(tempfile, "w");
- if (!fp) {
- perror("Error - Could not open temporary file");
- unlink(tempfilename);
- exit(1);
- }
-
- /* Get the cmos table header */
- hdr = (struct cmos_option_table *)cmos_table;
- /* Walk through the entry records */
- ptr = (struct lb_record *)(cmos_table + hdr->header_length);
- end = (struct lb_record *)(cmos_table + hdr->size);
- fprintf(fp, "/* This file is autogenerated.\n"
- " * See mainboard's cmos.layout file.\n */\n\n"
- "#ifndef __OPTION_TABLE_H\n#define __OPTION_TABLE_H\n\n");
-
- for(;ptr < end; ptr = (struct lb_record *)(((char *)ptr) + ptr->size)) {
- if (ptr->tag != LB_TAG_OPTION) {
- continue;
- }
- ce = (struct cmos_entries *)ptr;
-
- if (!is_ident((char *)ce->name)) {
- fprintf(stderr, "Invalid identifier: %s\n",
- ce->name);
- fclose(fp);
- unlink(tempfilename);
- exit(1);
- }
- fprintf(fp, "#define CMOS_VSTART_%s %d\n",
- ce->name, ce->bit);
- fprintf(fp, "#define CMOS_VLEN_%s %d\n",
- ce->name, ce->length);
- }
-
- if (cs != NULL) {
- fprintf(fp, "\n#define LB_CKS_RANGE_START %d\n", cs->range_start / 8);
- fprintf(fp, "#define LB_CKS_RANGE_END %d\n", cs->range_end / 8);
- fprintf(fp, "#define LB_CKS_LOC %d\n", cs->location / 8);
- } else {
- fprintf(stderr, "Error - No checksums defined.\n");
- fclose(fp);
- unlink(tempfilename);
- exit(1);
- }
- fprintf(fp, "\n#endif // __OPTION_TABLE_H\n");
- fclose(fp);
-
- UNLINK_IF_NECESSARY(header);
- if (rename(tempfilename, header)) {
- fprintf(stderr, "Error - Could not write %s: ", header);
- perror(NULL);
- unlink(tempfilename);
- exit(1);
- }
- }
-
- return 0;
-}
-
-
Vikram Narayanan (vikram186(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/912
-gerrit
commit bfa3db6abf2fc0b52bdf05cef7d34ca47c6093d7
Author: Vikram Narayanan <vikram186(a)gmail.com>
Date: Sat Apr 21 23:47:56 2012 +0530
cbtypes.h: Unify cbtypes.h used in AMD board's code
Remove all the repeated sections of code in cbtypes.h and place it
in a common location.
Change-Id: Ida92c2a7a88e9520b84b0dcbbf37cd5c9f63f798
Signed-off-by: Vikram Narayanan <vikram186(a)gmail.com>
---
src/include/cpu/amd/common/cbtypes.h | 68 +++++++++++++++++++++++++
src/mainboard/amd/torpedo/gpio.h | 2 +-
src/northbridge/amd/cimx/rd890/NbPlatform.h | 2 +-
src/northbridge/amd/cimx/rd890/amd.h | 3 +-
src/northbridge/amd/cimx/rd890/cbtypes.h | 71 ---------------------------
src/southbridge/amd/cimx/sb700/Platform.h | 2 +-
src/southbridge/amd/cimx/sb700/cbtypes.h | 53 --------------------
src/southbridge/amd/cimx/sb800/cbtypes.h | 53 --------------------
src/southbridge/amd/cimx/sb900/cbtypes.h | 59 ----------------------
9 files changed, 72 insertions(+), 241 deletions(-)
diff --git a/src/include/cpu/amd/common/cbtypes.h b/src/include/cpu/amd/common/cbtypes.h
new file mode 100644
index 0000000..4aed025
--- /dev/null
+++ b/src/include/cpu/amd/common/cbtypes.h
@@ -0,0 +1,68 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _CBTYPES_H_
+#define _CBTYPES_H_
+
+//#include <stdint.h>
+
+typedef signed long long __int64;
+typedef void VOID;
+typedef unsigned int UINTN;
+typedef signed char CHAR8;
+typedef unsigned char UINT8;
+typedef unsigned short UINT16;
+typedef unsigned int UINT32;
+typedef signed int INT32;
+typedef unsigned long long UINT64;
+typedef unsigned char BOOLEAN;
+
+#define DMSG_SB_TRACE 0x02
+#define TRACE(Arguments)
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef VOLATILE
+#define VOLATILE volatile
+#endif
+#ifndef CONST
+#define CONST const
+#endif
+
+#ifndef IN
+#define IN
+#endif
+#ifndef OUT
+#define OUT
+#endif
+
+
+#ifndef STATIC
+#define STATIC static
+#endif
+#ifndef VOLATILE
+#define VOLATILE volatile
+#endif
+
+#endif
diff --git a/src/mainboard/amd/torpedo/gpio.h b/src/mainboard/amd/torpedo/gpio.h
index 45394ef..a33323e 100644
--- a/src/mainboard/amd/torpedo/gpio.h
+++ b/src/mainboard/amd/torpedo/gpio.h
@@ -27,7 +27,7 @@
#define _GPIO_H_
#include <stdint.h>
-#include <cbtypes.h>
+#include <cpu/amd/common/cbtypes.h>
/*----------------------------------------------------------------------------------------
* D E F I N I T I O N S A N D M A C R O S
diff --git a/src/northbridge/amd/cimx/rd890/NbPlatform.h b/src/northbridge/amd/cimx/rd890/NbPlatform.h
index 824057a..629e810 100644
--- a/src/northbridge/amd/cimx/rd890/NbPlatform.h
+++ b/src/northbridge/amd/cimx/rd890/NbPlatform.h
@@ -94,7 +94,7 @@
#define CIMX_S3_SAVE 1
-#include "cbtypes.h"
+#include <cpu/amd/common/cbtypes.h>
#include <console/console.h>
#include "amd.h" //cimx typedef
diff --git a/src/northbridge/amd/cimx/rd890/amd.h b/src/northbridge/amd/cimx/rd890/amd.h
index d99f90f..3e2e78f 100644
--- a/src/northbridge/amd/cimx/rd890/amd.h
+++ b/src/northbridge/amd/cimx/rd890/amd.h
@@ -20,8 +20,7 @@
#ifndef _AMD_H_
#define _AMD_H_
-#include "cbtypes.h"
-
+#include <cpu/amd/common/cbtypes.h>
#define VOLATILE volatile
#define CALLCONV
diff --git a/src/northbridge/amd/cimx/rd890/cbtypes.h b/src/northbridge/amd/cimx/rd890/cbtypes.h
deleted file mode 100644
index ade55d7..0000000
--- a/src/northbridge/amd/cimx/rd890/cbtypes.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2010 - 2012 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CBTYPES_H_
-#define _CBTYPES_H_
-
-//#include <stdint.h>
-
-/*
-typedef int64_t __int64;
-typedef void VOID;
-typedef uint32_t UINTN;//
-typedef int8_t CHAR8;
-typedef uint8_t UINT8;
-typedef uint16_t UINT16;
-typedef uint32_t UINT32;
-typedef uint64_t UINT64;
-*/
-typedef signed long long __int64;
-typedef void VOID;
-typedef unsigned int UINTN;//
-typedef signed char CHAR8;
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef signed int INT32;
-typedef unsigned long long UINT64;
-
-#define TRUE 1
-#define FALSE 0
-typedef unsigned char BOOLEAN;
-
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-
-#ifndef IN
-#define IN
-#endif
-#ifndef OUT
-#define OUT
-#endif
-
-//porting.h
-#ifndef CONST
-#define CONST const
-#endif
-#ifndef STATIC
-#define STATIC static
-#endif
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-
-#endif
diff --git a/src/southbridge/amd/cimx/sb700/Platform.h b/src/southbridge/amd/cimx/sb700/Platform.h
index 15e5b07..d70345d 100644
--- a/src/southbridge/amd/cimx/sb700/Platform.h
+++ b/src/southbridge/amd/cimx/sb700/Platform.h
@@ -22,7 +22,7 @@
#pragma pack(push,1)
-#include "cbtypes.h"
+#include <cpu/amd/common/cbtypes.h>
#include <console/console.h>
#include <console/loglevel.h>
#ifdef NULL
diff --git a/src/southbridge/amd/cimx/sb700/cbtypes.h b/src/southbridge/amd/cimx/sb700/cbtypes.h
deleted file mode 100644
index d37e1e3..0000000
--- a/src/southbridge/amd/cimx/sb700/cbtypes.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2012 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CBTYPES_H_
-#define _CBTYPES_H_
-
-//#include <stdint.h>
-
-typedef signed long long __int64;
-typedef void VOID;
-typedef unsigned int UINTN;
-typedef signed char CHAR8;
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-typedef unsigned char BOOLEAN;
-
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-
-#ifndef IN
-#define IN
-#endif
-#ifndef OUT
-#define OUT
-#endif
-
-#endif
diff --git a/src/southbridge/amd/cimx/sb800/cbtypes.h b/src/southbridge/amd/cimx/sb800/cbtypes.h
deleted file mode 100644
index 03a0854..0000000
--- a/src/southbridge/amd/cimx/sb800/cbtypes.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CBTYPES_H_
-#define _CBTYPES_H_
-
-//#include <stdint.h>
-
-typedef signed long long __int64;
-typedef void VOID;
-typedef unsigned int UINTN;
-typedef signed char CHAR8;
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-typedef unsigned char BOOLEAN;
-
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-
-#ifndef IN
-#define IN
-#endif
-#ifndef OUT
-#define OUT
-#endif
-
-#endif
diff --git a/src/southbridge/amd/cimx/sb900/cbtypes.h b/src/southbridge/amd/cimx/sb900/cbtypes.h
deleted file mode 100644
index 4c97a33..0000000
--- a/src/southbridge/amd/cimx/sb900/cbtypes.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2011 Advanced Micro Devices, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CBTYPES_H_
-#define _CBTYPES_H_
-
-//#include <stdint.h>
-
-typedef signed long long __int64;
-typedef void VOID;
-typedef unsigned int UINTN;
-typedef signed char CHAR8;
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-typedef unsigned char BOOLEAN;
-
-#define DMSG_SB_TRACE 0x02
-#define TRACE(Arguments)
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef VOLATILE
-#define VOLATILE volatile
-#endif
-#ifndef CONST
-#define CONST const
-#endif
-
-#ifndef IN
-#define IN
-#endif
-#ifndef OUT
-#define OUT
-#endif
-
-#endif
Vikram Narayanan (vikram186(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/912
-gerrit
commit 6546d66e29dd37832e3d3cbe5493ddccb0833ef4
Author: Vikram Narayanan <vikram186(a)gmail.com>
Date: Sat Apr 21 23:47:56 2012 +0530
cbtypes.h: Unify cbtypes.h used in AMD board's code
Remove all the repeated sections of code in cbtypes.h and place it
in a common location.
Change-Id: Ida92c2a7a88e9520b84b0dcbbf37cd5c9f63f798
Signed-off-by: Vikram Narayanan <vikram186(a)gmail.com>
---
src/include/cpu/amd/common/cbtypes.h | 68 +++++++++++++++++++++++++++
src/mainboard/amd/torpedo/gpio.h | 2 +-
src/northbridge/amd/cimx/rd890/NbPlatform.h | 2 +-
src/northbridge/amd/cimx/rd890/amd.h | 3 +-
src/southbridge/amd/cimx/sb700/Platform.h | 2 +-
5 files changed, 72 insertions(+), 5 deletions(-)
diff --git a/src/include/cpu/amd/common/cbtypes.h b/src/include/cpu/amd/common/cbtypes.h
new file mode 100644
index 0000000..4aed025
--- /dev/null
+++ b/src/include/cpu/amd/common/cbtypes.h
@@ -0,0 +1,68 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _CBTYPES_H_
+#define _CBTYPES_H_
+
+//#include <stdint.h>
+
+typedef signed long long __int64;
+typedef void VOID;
+typedef unsigned int UINTN;
+typedef signed char CHAR8;
+typedef unsigned char UINT8;
+typedef unsigned short UINT16;
+typedef unsigned int UINT32;
+typedef signed int INT32;
+typedef unsigned long long UINT64;
+typedef unsigned char BOOLEAN;
+
+#define DMSG_SB_TRACE 0x02
+#define TRACE(Arguments)
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef VOLATILE
+#define VOLATILE volatile
+#endif
+#ifndef CONST
+#define CONST const
+#endif
+
+#ifndef IN
+#define IN
+#endif
+#ifndef OUT
+#define OUT
+#endif
+
+
+#ifndef STATIC
+#define STATIC static
+#endif
+#ifndef VOLATILE
+#define VOLATILE volatile
+#endif
+
+#endif
diff --git a/src/mainboard/amd/torpedo/gpio.h b/src/mainboard/amd/torpedo/gpio.h
index 45394ef..a33323e 100644
--- a/src/mainboard/amd/torpedo/gpio.h
+++ b/src/mainboard/amd/torpedo/gpio.h
@@ -27,7 +27,7 @@
#define _GPIO_H_
#include <stdint.h>
-#include <cbtypes.h>
+#include <cpu/amd/common/cbtypes.h>
/*----------------------------------------------------------------------------------------
* D E F I N I T I O N S A N D M A C R O S
diff --git a/src/northbridge/amd/cimx/rd890/NbPlatform.h b/src/northbridge/amd/cimx/rd890/NbPlatform.h
index 824057a..629e810 100644
--- a/src/northbridge/amd/cimx/rd890/NbPlatform.h
+++ b/src/northbridge/amd/cimx/rd890/NbPlatform.h
@@ -94,7 +94,7 @@
#define CIMX_S3_SAVE 1
-#include "cbtypes.h"
+#include <cpu/amd/common/cbtypes.h>
#include <console/console.h>
#include "amd.h" //cimx typedef
diff --git a/src/northbridge/amd/cimx/rd890/amd.h b/src/northbridge/amd/cimx/rd890/amd.h
index d99f90f..3e2e78f 100644
--- a/src/northbridge/amd/cimx/rd890/amd.h
+++ b/src/northbridge/amd/cimx/rd890/amd.h
@@ -20,8 +20,7 @@
#ifndef _AMD_H_
#define _AMD_H_
-#include "cbtypes.h"
-
+#include <cpu/amd/common/cbtypes.h>
#define VOLATILE volatile
#define CALLCONV
diff --git a/src/southbridge/amd/cimx/sb700/Platform.h b/src/southbridge/amd/cimx/sb700/Platform.h
index 15e5b07..d70345d 100644
--- a/src/southbridge/amd/cimx/sb700/Platform.h
+++ b/src/southbridge/amd/cimx/sb700/Platform.h
@@ -22,7 +22,7 @@
#pragma pack(push,1)
-#include "cbtypes.h"
+#include <cpu/amd/common/cbtypes.h>
#include <console/console.h>
#include <console/loglevel.h>
#ifdef NULL
the following patch was just integrated into master:
commit 87b3cab7f6ef4b8845de540c40b643c41ff3fdef
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Thu Apr 19 12:00:06 2012 +0300
Makefile: define build result directories
Final build results (.elf, .debug, .map) are to be placed under
directory $(objcbfs), the default is:
$(obj)/cbfs/$(CONFIG_CBFS_PREFIX)/
Intermediate build results (.o, .s, .S, .inc, .ld) that do not have
a clear one-to-one relation to a file under src/ are to be placed
under directory $(objgenerated), the default is:
$(obj)/generated
Also defines implicit rules for final build results:
.debug -> .elf and .map
.elf -> .bin
Change-Id: I448c6b7c9a952e54170df42091d7db438025a795
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-By: Patrick Georgi <patrick(a)georgi-clan.de> at Sat Apr 21 09:41:27 2012, giving +2
See http://review.coreboot.org/858 for details.
-gerrit
the following patch was just integrated into master:
commit bde4191986a64775c2a4c5bfc53c3b22cf202276
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Wed Apr 18 21:13:33 2012 +0300
Intel e7505: build as separate object file
No longer include northbridge files directly in the source for
mainboard romstage.c and fix includes.
Also make required adjustments to function declarations.
Change-Id: Iafdcc0766ed44c64cc628e5935eef2c6372f5f22
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-By: Patrick Georgi <patrick(a)georgi-clan.de> at Sat Apr 21 09:38:55 2012, giving +2
See http://review.coreboot.org/906 for details.
-gerrit
the following patch was just integrated into master:
commit 639293da17094e58b9ff95bb2c1b8fb738b01df3
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Wed Apr 18 20:33:35 2012 +0300
Intel e7505: enable ECC scrubbing
It takes about 3 seconds to scrub 8GiB DDR266 RAM.
After ECC scrub XIP cache is disabled for system stability. There is
very little to do in romstage after ECC scrub, especially when RAM
debug messages are turned off. So the delay caused by this is hardly
noticeable.
Cache for complete ROM is re-enabled before ramstage is decompressed,
and it has no unstability issues. So the code required to re-enable
cache for ROM currently already exists in cache-as-ram_ht.inc.
A Kconfig option HW_SCRUBBER enables the scrub to be run on hard
reboots and power-ons.
Change-Id: Icf27acf73240c06b58091f1229efc0f01cca3f85
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-By: Patrick Georgi <patrick(a)georgi-clan.de> at Sat Apr 21 09:37:03 2012, giving +2
See http://review.coreboot.org/905 for details.
-gerrit
the following patch was just integrated into master:
commit 1a130dda9fc144e68f2ce79ee3b18e1b2f4db448
Author: Vikram Narayanan <vikram186(a)gmail.com>
Date: Sat Apr 14 15:25:13 2012 +0530
nvramtool: Unify nvramtool and build_opt_tbl
As cmos.layout parsing capabilities are already there in nvramtool,
use those than using build_opt_tbl.c. Add binary and header file
generation in nvramtool. Make appropriate changes to Makefile.inc.
Change-Id: Iaf3f5d4f51451aeb33c92800a0c895045f2388cf
Signed-off-by: Vikram Narayanan <vikram186(a)gmail.com>
Reviewed-By: Patrick Georgi <patrick(a)georgi-clan.de> at Sat Apr 21 09:36:23 2012, giving +2
See http://review.coreboot.org/898 for details.
-gerrit