diff mbox

[U-Boot,03/12] x86: Clean up coreboot_tables.h

Message ID 1456642686-18887-4-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit f2d0690e28722ffe045ca8e8c4bae9df2fd97582
Delegated to: Bin Meng
Headers show

Commit Message

Bin Meng Feb. 28, 2016, 6:57 a.m. UTC
Clean up this file a little bit:
- Remove inclusion of <linux/compiler.h>
- Use tab in the macro definition
- Remove table definitions that are not needed

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/include/asm/coreboot_tables.h | 153 +++++++++++++++++----------------
 1 file changed, 80 insertions(+), 73 deletions(-)

Comments

Simon Glass Feb. 29, 2016, 4:19 a.m. UTC | #1
On 27 February 2016 at 23:57, Bin Meng <bmeng.cn@gmail.com> wrote:
> Clean up this file a little bit:
> - Remove inclusion of <linux/compiler.h>
> - Use tab in the macro definition
> - Remove table definitions that are not needed
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/include/asm/coreboot_tables.h | 153 +++++++++++++++++----------------
>  1 file changed, 80 insertions(+), 73 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng Feb. 29, 2016, 7:31 a.m. UTC | #2
On Mon, Feb 29, 2016 at 12:19 PM, Simon Glass <sjg@chromium.org> wrote:
> On 27 February 2016 at 23:57, Bin Meng <bmeng.cn@gmail.com> wrote:
>> Clean up this file a little bit:
>> - Remove inclusion of <linux/compiler.h>
>> - Use tab in the macro definition
>> - Remove table definitions that are not needed
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>  arch/x86/include/asm/coreboot_tables.h | 153 +++++++++++++++++----------------
>>  1 file changed, 80 insertions(+), 73 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86/next, thanks!
diff mbox

Patch

diff --git a/arch/x86/include/asm/coreboot_tables.h b/arch/x86/include/asm/coreboot_tables.h
index 98a95cd..ab4425f 100644
--- a/arch/x86/include/asm/coreboot_tables.h
+++ b/arch/x86/include/asm/coreboot_tables.h
@@ -9,8 +9,6 @@ 
 #ifndef _COREBOOT_TABLES_H
 #define _COREBOOT_TABLES_H
 
-#include <linux/compiler.h>
-
 struct cbuint64 {
 	u32 lo;
 	u32 hi;
@@ -30,8 +28,8 @@  struct cb_record {
 	u32 size;
 };
 
-#define CB_TAG_UNUSED     0x0000
-#define CB_TAG_MEMORY     0x0001
+#define CB_TAG_UNUSED			0x0000
+#define CB_TAG_MEMORY			0x0001
 
 struct cb_memory_range {
 	struct cbuint64 start;
@@ -39,13 +37,13 @@  struct cb_memory_range {
 	u32 type;
 };
 
-#define CB_MEM_RAM          1
-#define CB_MEM_RESERVED     2
-#define CB_MEM_ACPI         3
-#define CB_MEM_NVS          4
-#define CB_MEM_UNUSABLE     5
-#define CB_MEM_VENDOR_RSVD  6
-#define CB_MEM_TABLE       16
+#define CB_MEM_RAM			1
+#define CB_MEM_RESERVED			2
+#define CB_MEM_ACPI			3
+#define CB_MEM_NVS			4
+#define CB_MEM_UNUSABLE			5
+#define CB_MEM_VENDOR_RSVD		6
+#define CB_MEM_TABLE			16
 
 struct cb_memory {
 	u32 tag;
@@ -53,7 +51,7 @@  struct cb_memory {
 	struct cb_memory_range map[0];
 };
 
-#define CB_TAG_HWRPB      0x0002
+#define CB_TAG_HWRPB			0x0002
 
 struct cb_hwrpb {
 	u32 tag;
@@ -61,7 +59,7 @@  struct cb_hwrpb {
 	u64 hwrpb;
 };
 
-#define CB_TAG_MAINBOARD  0x0003
+#define CB_TAG_MAINBOARD		0x0003
 
 struct cb_mainboard {
 	u32 tag;
@@ -71,16 +69,16 @@  struct cb_mainboard {
 	u8 strings[0];
 };
 
-#define CB_TAG_VERSION        0x0004
-#define CB_TAG_EXTRA_VERSION  0x0005
-#define CB_TAG_BUILD          0x0006
-#define CB_TAG_COMPILE_TIME   0x0007
-#define CB_TAG_COMPILE_BY     0x0008
-#define CB_TAG_COMPILE_HOST   0x0009
-#define CB_TAG_COMPILE_DOMAIN 0x000a
-#define CB_TAG_COMPILER       0x000b
-#define CB_TAG_LINKER         0x000c
-#define CB_TAG_ASSEMBLER      0x000d
+#define CB_TAG_VERSION			0x0004
+#define CB_TAG_EXTRA_VERSION		0x0005
+#define CB_TAG_BUILD			0x0006
+#define CB_TAG_COMPILE_TIME		0x0007
+#define CB_TAG_COMPILE_BY		0x0008
+#define CB_TAG_COMPILE_HOST		0x0009
+#define CB_TAG_COMPILE_DOMAIN		0x000a
+#define CB_TAG_COMPILER			0x000b
+#define CB_TAG_LINKER			0x000c
+#define CB_TAG_ASSEMBLER		0x000d
 
 struct cb_string {
 	u32 tag;
@@ -88,19 +86,19 @@  struct cb_string {
 	u8 string[0];
 };
 
-#define CB_TAG_SERIAL         0x000f
+#define CB_TAG_SERIAL			0x000f
 
 struct cb_serial {
 	u32 tag;
 	u32 size;
-#define CB_SERIAL_TYPE_IO_MAPPED     1
-#define CB_SERIAL_TYPE_MEMORY_MAPPED 2
+#define CB_SERIAL_TYPE_IO_MAPPED	1
+#define CB_SERIAL_TYPE_MEMORY_MAPPED	2
 	u32 type;
 	u32 baseaddr;
 	u32 baud;
 };
 
-#define CB_TAG_CONSOLE       0x00010
+#define CB_TAG_CONSOLE			0x0010
 
 struct cb_console {
 	u32 tag;
@@ -108,14 +106,14 @@  struct cb_console {
 	u16 type;
 };
 
-#define CB_TAG_CONSOLE_SERIAL8250 0
-#define CB_TAG_CONSOLE_VGA        1 /* OBSOLETE */
-#define CB_TAG_CONSOLE_BTEXT      2 /* OBSOLETE */
-#define CB_TAG_CONSOLE_LOGBUF     3
-#define CB_TAG_CONSOLE_SROM       4 /* OBSOLETE */
-#define CB_TAG_CONSOLE_EHCI       5
+#define CB_TAG_CONSOLE_SERIAL8250	0
+#define CB_TAG_CONSOLE_VGA		1 /* OBSOLETE */
+#define CB_TAG_CONSOLE_BTEXT		2 /* OBSOLETE */
+#define CB_TAG_CONSOLE_LOGBUF		3
+#define CB_TAG_CONSOLE_SROM		4 /* OBSOLETE */
+#define CB_TAG_CONSOLE_EHCI		5
 
-#define CB_TAG_FORWARD       0x00011
+#define CB_TAG_FORWARD			0x0011
 
 struct cb_forward {
 	u32 tag;
@@ -123,11 +121,11 @@  struct cb_forward {
 	u64 forward;
 };
 
-#define CB_TAG_FRAMEBUFFER      0x0012
+#define CB_TAG_FRAMEBUFFER		0x0012
+
 struct cb_framebuffer {
 	u32 tag;
 	u32 size;
-
 	u64 physical_address;
 	u32 x_resolution;
 	u32 y_resolution;
@@ -143,8 +141,9 @@  struct cb_framebuffer {
 	u8 reserved_mask_size;
 };
 
-#define CB_TAG_GPIO 0x0013
-#define GPIO_MAX_NAME_LENGTH 16
+#define CB_TAG_GPIO			0x0013
+#define GPIO_MAX_NAME_LENGTH		16
+
 struct cb_gpio {
 	u32 port;
 	u32 polarity;
@@ -155,36 +154,39 @@  struct cb_gpio {
 struct cb_gpios {
 	u32 tag;
 	u32 size;
-
 	u32 count;
 	struct cb_gpio gpios[0];
 };
 
-#define CB_TAG_FDT	0x0014
+#define CB_TAG_FDT			0x0014
+
 struct cb_fdt {
 	uint32_t tag;
 	uint32_t size;	/* size of the entire entry */
 	/* the actual FDT gets placed here */
 };
 
-#define CB_TAG_VDAT	0x0015
+#define CB_TAG_VDAT			0x0015
+
 struct cb_vdat {
 	uint32_t tag;
 	uint32_t size;	/* size of the entire entry */
-	void	 *vdat_addr;
+	void *vdat_addr;
 	uint32_t vdat_size;
 };
 
-#define CB_TAG_TIMESTAMPS	0x0016
-#define CB_TAG_CBMEM_CONSOLE	0x0017
-#define CB_TAG_MRC_CACHE	0x0018
+#define CB_TAG_TIMESTAMPS		0x0016
+#define CB_TAG_CBMEM_CONSOLE		0x0017
+#define CB_TAG_MRC_CACHE		0x0018
+
 struct cb_cbmem_tab {
 	uint32_t tag;
 	uint32_t size;
-	void   *cbmem_tab;
+	void *cbmem_tab;
 };
 
-#define CB_TAG_VBNV		0x0019
+#define CB_TAG_VBNV			0x0019
+
 struct cb_vbnv {
 	uint32_t tag;
 	uint32_t size;
@@ -192,15 +194,18 @@  struct cb_vbnv {
 	uint32_t vbnv_size;
 };
 
-#define CB_TAG_CMOS_OPTION_TABLE 0x00c8
+#define CB_TAG_CMOS_OPTION_TABLE	0x00c8
+
 struct cb_cmos_option_table {
 	u32 tag;
 	u32 size;
 	u32 header_length;
 };
 
-#define CB_TAG_OPTION         0x00c9
-#define CMOS_MAX_NAME_LENGTH    32
+#define CB_TAG_OPTION			0x00c9
+
+#define CMOS_MAX_NAME_LENGTH		32
+
 struct cb_cmos_entries {
 	u32 tag;
 	u32 size;
@@ -211,9 +216,9 @@  struct cb_cmos_entries {
 	u8 name[CMOS_MAX_NAME_LENGTH];
 };
 
+#define CB_TAG_OPTION_ENUM		0x00ca
+#define CMOS_MAX_TEXT_LENGTH		32
 
-#define CB_TAG_OPTION_ENUM    0x00ca
-#define CMOS_MAX_TEXT_LENGTH 32
 struct cb_cmos_enums {
 	u32 tag;
 	u32 size;
@@ -222,8 +227,9 @@  struct cb_cmos_enums {
 	u8 text[CMOS_MAX_TEXT_LENGTH];
 };
 
-#define CB_TAG_OPTION_DEFAULTS 0x00cb
-#define CMOS_IMAGE_BUFFER_SIZE 128
+#define CB_TAG_OPTION_DEFAULTS		0x00cb
+#define CMOS_IMAGE_BUFFER_SIZE		128
+
 struct cb_cmos_defaults {
 	u32 tag;
 	u32 size;
@@ -232,9 +238,10 @@  struct cb_cmos_defaults {
 	u8 default_set[CMOS_IMAGE_BUFFER_SIZE];
 };
 
-#define CB_TAG_OPTION_CHECKSUM 0x00cc
-#define CHECKSUM_NONE	0
-#define CHECKSUM_PCBIOS	1
+#define CB_TAG_OPTION_CHECKSUM		0x00cc
+#define CHECKSUM_NONE			0
+#define CHECKSUM_PCBIOS			1
+
 struct	cb_cmos_checksum {
 	u32 tag;
 	u32 size;
@@ -262,9 +269,9 @@  struct	cb_cmos_checksum {
 #define UNPACK_CB64(_in) \
 	((((u64) _in.hi) << 32) | _in.lo)
 
-#define CBMEM_TOC_RESERVED      512
-#define MAX_CBMEM_ENTRIES       16
-#define CBMEM_MAGIC             0x434f5245
+#define CBMEM_TOC_RESERVED		512
+#define MAX_CBMEM_ENTRIES		16
+#define CBMEM_MAGIC			0x434f5245
 
 struct cbmem_entry {
 	u32 magic;
@@ -273,18 +280,18 @@  struct cbmem_entry {
 	u64 size;
 } __packed;
 
-#define CBMEM_ID_FREESPACE      0x46524545
-#define CBMEM_ID_GDT            0x4c474454
-#define CBMEM_ID_ACPI           0x41435049
-#define CBMEM_ID_CBTABLE        0x43425442
-#define CBMEM_ID_PIRQ           0x49525154
-#define CBMEM_ID_MPTABLE        0x534d5054
-#define CBMEM_ID_RESUME         0x5245534d
-#define CBMEM_ID_RESUME_SCRATCH 0x52455343
-#define CBMEM_ID_SMBIOS         0x534d4254
-#define CBMEM_ID_TIMESTAMP      0x54494d45
-#define CBMEM_ID_MRCDATA        0x4d524344
-#define CBMEM_ID_CONSOLE        0x434f4e53
-#define CBMEM_ID_NONE           0x00000000
+#define CBMEM_ID_FREESPACE		0x46524545
+#define CBMEM_ID_GDT			0x4c474454
+#define CBMEM_ID_ACPI			0x41435049
+#define CBMEM_ID_CBTABLE		0x43425442
+#define CBMEM_ID_PIRQ			0x49525154
+#define CBMEM_ID_MPTABLE		0x534d5054
+#define CBMEM_ID_RESUME			0x5245534d
+#define CBMEM_ID_RESUME_SCRATCH		0x52455343
+#define CBMEM_ID_SMBIOS			0x534d4254
+#define CBMEM_ID_TIMESTAMP		0x54494d45
+#define CBMEM_ID_MRCDATA		0x4d524344
+#define CBMEM_ID_CONSOLE		0x434f4e53
+#define CBMEM_ID_NONE			0x00000000
 
 #endif