diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2014-07-31 00:19:45 +0530 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-07-31 11:11:47 +1000 |
commit | fab72d6ab651b4cf6ef32d5bcfb63ef8743274d8 (patch) | |
tree | 59e1fca7b1dc8995635d4f09c1152b3230358948 | |
parent | 04604b5f49af98ee97f6edea0278282624ed9cbe (diff) | |
download | skiboot-fab72d6ab651b4cf6ef32d5bcfb63ef8743274d8.zip skiboot-fab72d6ab651b4cf6ef32d5bcfb63ef8743274d8.tar.gz skiboot-fab72d6ab651b4cf6ef32d5bcfb63ef8743274d8.tar.bz2 |
MDST: Rename function name and variable order
- Better function naming
- Better macro naming
- Re-ordered function variables
- calculate max_mdst_entry after allocating memory
for mdst table.
No change in functionality.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | hdata/spira.c | 4 | ||||
-rw-r--r-- | hw/fsp/fsp-mdst-table.c | 22 | ||||
-rw-r--r-- | include/fsp-mdst-table.h | 6 |
3 files changed, 16 insertions, 16 deletions
diff --git a/hdata/spira.c b/hdata/spira.c index 39a78e8..45c282c 100644 --- a/hdata/spira.c +++ b/hdata/spira.c @@ -61,12 +61,12 @@ __section(".procin.data") struct proc_init_data proc_init_data = { __section(".mdst.data") struct dump_mdst_table init_mdst_table[2] = { { .addr = CPU_TO_BE64(INMEM_CON_START | ADDR_TOP_BIT), - .type = CPU_TO_BE32(DUMP_SECTION_CONSOLE), + .type = CPU_TO_BE32(DUMP_REGION_CONSOLE), .size = CPU_TO_BE32(INMEM_CON_LEN), }, { .addr = CPU_TO_BE64(HBRT_CON_START | ADDR_TOP_BIT), - .type = CPU_TO_BE32(DUMP_SECTION_HBRT_LOG), + .type = CPU_TO_BE32(DUMP_REGION_HBRT_LOG), .size = CPU_TO_BE32(HBRT_CON_LEN), }, }; diff --git a/hw/fsp/fsp-mdst-table.c b/hw/fsp/fsp-mdst-table.c index 5b29948..5dbe531 100644 --- a/hw/fsp/fsp-mdst-table.c +++ b/hw/fsp/fsp-mdst-table.c @@ -122,7 +122,7 @@ static int64_t fsp_update_mdst_table(void) } /* Add entry to MDST table */ -static int __mdst_table_add_entry(void *addr, uint32_t type, uint32_t size) +static int __dump_region_add_entry(uint32_t id, void *addr, uint32_t size) { int rc = OPAL_INTERNAL_ERROR; @@ -147,8 +147,8 @@ static int __mdst_table_add_entry(void *addr, uint32_t type, uint32_t size) fsp_tce_map(PSI_DMA_HYP_DUMP + cur_dump_size, addr, ALIGN_UP(size, TCE_PSIZE)); /* Add entry to MDST table */ + mdst_table[cur_mdst_entry].type = id; mdst_table[cur_mdst_entry].addr = PSI_DMA_HYP_DUMP + cur_dump_size; - mdst_table[cur_mdst_entry].type = type; mdst_table[cur_mdst_entry].size = size; /* Update MDST count and dump size */ @@ -165,19 +165,19 @@ out: return rc; } -static int mdst_table_add_entries(void) +static int dump_region_add_entries(void) { int rc; /* Add console buffer */ - rc = __mdst_table_add_entry((void *)INMEM_CON_START, - DUMP_SECTION_CONSOLE, INMEM_CON_LEN); + rc = __dump_region_add_entry(DUMP_REGION_CONSOLE, + (void *)INMEM_CON_START, INMEM_CON_LEN); if (rc) return rc; /* Add HBRT buffer */ - rc = __mdst_table_add_entry((void *)HBRT_CON_START, - DUMP_SECTION_HBRT_LOG, HBRT_CON_LEN); + rc = __dump_region_add_entry(DUMP_REGION_HBRT_LOG, + (void *)HBRT_CON_START, HBRT_CON_LEN); return rc; } @@ -191,9 +191,6 @@ static inline void mdst_table_tce_map(void) /* Initialize MDST table */ static int mdst_table_init(void) { - max_mdst_entry = PSI_DMA_MDST_TABLE_SIZE / sizeof(*mdst_table); - printf("MDST: Max entries in MDST table : %d\n", max_mdst_entry); - mdst_table = memalign(TCE_PSIZE, PSI_DMA_MDST_TABLE_SIZE); if (!mdst_table) { log_simple_error(&e_info(OPAL_RC_DUMP_MDST_INIT), @@ -204,6 +201,9 @@ static int mdst_table_init(void) memset(mdst_table, 0, PSI_DMA_MDST_TABLE_SIZE); mdst_table_tce_map(); + max_mdst_entry = PSI_DMA_MDST_TABLE_SIZE / sizeof(*mdst_table); + printf("MDST: Max entries in MDST table : %d\n", max_mdst_entry); + return OPAL_SUCCESS; } @@ -244,7 +244,7 @@ void fsp_mdst_table_init(void) * Ignore return code from mdst_table_add_entries so that * we can atleast capture partial dump. */ - mdst_table_add_entries(); + dump_region_add_entries(); fsp_update_mdst_table(); /* Register for Class AA (FSP R/R) */ diff --git a/include/fsp-mdst-table.h b/include/fsp-mdst-table.h index ae2ef12..78ab276 100644 --- a/include/fsp-mdst-table.h +++ b/include/fsp-mdst-table.h @@ -18,9 +18,9 @@ #ifndef __FSPMDST_H #define __FSPMDST_H -/* Dump section type */ -#define DUMP_SECTION_CONSOLE 0x01 -#define DUMP_SECTION_HBRT_LOG 0x02 +/* Dump region ids */ +#define DUMP_REGION_CONSOLE 0x01 +#define DUMP_REGION_HBRT_LOG 0x02 /* * Sapphire Memory Dump Source Table |