[flashrom] [PATCH 3/6] fixup! add ICH/PCH flash descriptor decoding

Stefan Tauner stefan.tauner at student.tuwien.ac.at
Wed Jun 15 00:20:29 CEST 2011


Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
---
 Makefile                           |    3 +-
 ich_descriptors.c                  |   53 +++++++++++++++++------------------
 util/ich_descriptors_tool/Makefile |    2 +-
 3 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/Makefile b/Makefile
index b61031f..8679f00 100644
--- a/Makefile
+++ b/Makefile
@@ -223,7 +223,8 @@ ifeq ($(CONFIG_INTERNAL), yes)
 FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1'
 PROGRAMMER_OBJS += processor_enable.o chipset_enable.o board_enable.o cbtable.o dmi.o internal.o
 # FIXME: The PROGRAMMER_OBJS below should only be included on x86.
-PROGRAMMER_OBJS += it87spi.o it85spi.o ichspi.o ich_descriptors.o sb600spi.o wbsio_spi.o mcp6x_spi.o
+PROGRAMMER_OBJS += it87spi.o it85spi.o sb600spi.o wbsio_spi.o mcp6x_spi.o
+PROGRAMMER_OBJS += ichspi.o ich_descriptors.o
 NEED_PCI := yes
 endif
 
diff --git a/ich_descriptors.c b/ich_descriptors.c
index 0b03624..a268f7d 100644
--- a/ich_descriptors.c
+++ b/ich_descriptors.c
@@ -31,22 +31,22 @@ struct flash_component fcba = { {0} };
 struct flash_region frba = { {0} };
 struct flash_master fmba = { {0} };
 
-uint32_t getFCBA()
+uint32_t getFCBA(void)
 {
 	return (fdbar.FLMAP0 <<  4) & 0x00000ff0;
 }
 
-uint32_t getFRBA()
+uint32_t getFRBA(void)
 {
 	return (fdbar.FLMAP0 >> 12) & 0x00000ff0;
 }
 
-uint32_t getFMBA()
+uint32_t getFMBA(void)
 {
 	return (fdbar.FLMAP1 <<  4) & 0x00000ff0;
 }
 
-uint32_t getFMSBA()
+uint32_t getFMSBA(void)
 {
 	return (fdbar.FLMAP2 <<  4) & 0x00000ff0;
 }
@@ -61,7 +61,7 @@ uint32_t getFLREG_base(uint32_t flreg)
 	return (flreg << 12) & 0x01fff000;
 }
 
-uint32_t getFISBA()
+uint32_t getFISBA(void)
 {
 	return (fdbar.FLMAP1 >> 12) & 0x00000ff0;
 }
@@ -95,8 +95,7 @@ int getFCBA_component_density(uint8_t comp)
 	}
 	if (size_enc > 5) {
 		msg_perr("Density of component with index %d illegal or "
-			 "unsupported. Encoded density is 0x%x.\n",
-			 comp,
+			 "unsupported. Encoded density is 0x%x.\n", comp,
 			 size_enc);
 		return 0;
 	}
@@ -104,7 +103,7 @@ int getFCBA_component_density(uint8_t comp)
 }
 
 #ifdef ICH_DESCRIPTORS_FROM_MMAP_DUMP
-uint32_t getVTBA()
+uint32_t getVTBA(void)
 {
 	return (flumap.FLUMAP1 << 4) & 0x0ff0;
 }
@@ -123,7 +122,7 @@ const struct flash_descriptor_addresses desc_addr = {
 #endif
 };
 
-void pretty_print_ich_descriptors()
+void pretty_print_ich_descriptors(void)
 {
 	pretty_print_ich_descriptor_map();
 	pretty_print_ich_descriptor_component();
@@ -162,7 +161,7 @@ void pretty_print_ich_descriptor_map(void)
 
 void pretty_print_ich_descriptor_component(void)
 {
-	const char * str_freq[8] = {
+	const char * const str_freq[8] = {
 		"20 MHz",		/* 000 */
 		"33 MHz",		/* 001 */
 		"reserved/illegal",	/* 010 */
@@ -172,7 +171,7 @@ void pretty_print_ich_descriptor_component(void)
 		"reserved/illegal",	/* 110 */
 		"reserved/illegal"	/* 111 */
 	};
-	const char * str_mem[8] = {
+	const char * const str_mem[8] = {
 		"512kB",
 		"1 MB",
 		"2 MB",
@@ -273,10 +272,10 @@ void pretty_print_ich_descriptor_master(void)
 #ifdef ICH_DESCRIPTORS_FROM_MMAP_DUMP
 void pretty_print_ich_descriptor_straps_ich8(void)
 {
-	const char * str_GPIO12[4] = {
+	const char * const str_GPIO12[4] = {
 		"GPIO12",
 		"LAN PHY Power Control Function (Native Output)",
-		" GLAN_DOCK# (Native Input)",
+		"GLAN_DOCK# (Native Input)",
 		"invalid configuration",
 	};
 
@@ -361,15 +360,15 @@ int read_ich_descriptors_from_dump(uint32_t *dump)
 	}
 
 	/* map */
-	fdbar.FLVALSIG = dump[0 + pch_bug_offset];
-	fdbar.FLMAP0   = dump[1 + pch_bug_offset];
-	fdbar.FLMAP1   = dump[2 + pch_bug_offset];
-	fdbar.FLMAP2   = dump[3 + pch_bug_offset];
+	fdbar.FLVALSIG	= dump[0 + pch_bug_offset];
+	fdbar.FLMAP0	= dump[1 + pch_bug_offset];
+	fdbar.FLMAP1	= dump[2 + pch_bug_offset];
+	fdbar.FLMAP2	= dump[3 + pch_bug_offset];
 
 	/* component */
-	fcba.FLCOMP = dump[(desc_addr.FCBA() >> 2) + 0];
-	fcba.FLILL  = dump[(desc_addr.FCBA() >> 2) + 1];
-	fcba.FLPB  = dump[(desc_addr.FCBA() >> 2) + 2];
+	fcba.FLCOMP	= dump[(desc_addr.FCBA() >> 2) + 0];
+	fcba.FLILL	= dump[(desc_addr.FCBA() >> 2) + 1];
+	fcba.FLPB	= dump[(desc_addr.FCBA() >> 2) + 2];
 
 	/* region */
 	frba.FLREG0 = dump[(desc_addr.FRBA() >> 2) + 0];
@@ -423,15 +422,15 @@ void read_ich_descriptors_from_fdo(void *spibar)
 	msg_pdbg("Reading flash descriptors "
 		 "mapped by the chipset via FDOC/FDOD...");
 	/* descriptor map section */
-	fdbar.FLVALSIG = read_descriptor_reg(0, 0, spibar);
-	fdbar.FLMAP0   = read_descriptor_reg(0, 1, spibar);
-	fdbar.FLMAP1   = read_descriptor_reg(0, 2, spibar);
-	fdbar.FLMAP2   = read_descriptor_reg(0, 3, spibar);
+	fdbar.FLVALSIG	= read_descriptor_reg(0, 0, spibar);
+	fdbar.FLMAP0	= read_descriptor_reg(0, 1, spibar);
+	fdbar.FLMAP1	= read_descriptor_reg(0, 2, spibar);
+	fdbar.FLMAP2	= read_descriptor_reg(0, 3, spibar);
 
 	/* component section */
-	fcba.FLCOMP = read_descriptor_reg(1, 0, spibar);
-	fcba.FLILL  = read_descriptor_reg(1, 1, spibar);
-	fcba.FLPB  = read_descriptor_reg(1, 2, spibar);
+	fcba.FLCOMP	= read_descriptor_reg(1, 0, spibar);
+	fcba.FLILL	= read_descriptor_reg(1, 1, spibar);
+	fcba.FLPB	= read_descriptor_reg(1, 2, spibar);
 
 	/* region section */
 	frba.FLREG0 = read_descriptor_reg(2, 0, spibar);
diff --git a/util/ich_descriptors_tool/Makefile b/util/ich_descriptors_tool/Makefile
index 9b1d096..0592b67 100644
--- a/util/ich_descriptors_tool/Makefile
+++ b/util/ich_descriptors_tool/Makefile
@@ -39,4 +39,4 @@ clean:
 # Include the dependency files.
 -include $(shell mkdir -p $(DEPPATH) $(OBJATH) 2>/dev/null) $(wildcard $(DEPPATH)/*)
 
-.PHONY: all clean
\ No newline at end of file
+.PHONY: all clean
-- 
1.7.1





More information about the flashrom mailing list