From 04d025cf5015b06f9e4dafc7092cfbd5d24b241e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Wed, 3 Jul 2019 06:50:19 +0300 Subject: amdfam10: Declare get_sysinfo() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's forbidden to use dereference CAR_GLOBAL variables directly. The notation fails after CAR teardown for romstage. Change-Id: I6e6285ca0f520608c2a344517fbac943aeb36d87 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/33995 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- src/northbridge/amd/amdfam10/amdfam10.h | 6 ------ src/northbridge/amd/amdfam10/raminit.h | 1 + src/northbridge/amd/amdfam10/raminit_amdmct.c | 7 ++++++- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/northbridge') diff --git a/src/northbridge/amd/amdfam10/amdfam10.h b/src/northbridge/amd/amdfam10/amdfam10.h index d2a05287df..0fbcea687c 100644 --- a/src/northbridge/amd/amdfam10/amdfam10.h +++ b/src/northbridge/amd/amdfam10/amdfam10.h @@ -989,12 +989,6 @@ struct sys_info { struct DCTStatStruc DCTstatA[NODE_NUMS]; } __packed; - -/* -#ifdef __PRE_RAM__ -extern struct sys_info sysinfo_car; -#endif -*/ #ifndef __PRE_RAM__ struct device *get_node_pci(u32 nodeid, u32 fn); #endif diff --git a/src/northbridge/amd/amdfam10/raminit.h b/src/northbridge/amd/amdfam10/raminit.h index 9d1d91d536..c9c57ff2c2 100644 --- a/src/northbridge/amd/amdfam10/raminit.h +++ b/src/northbridge/amd/amdfam10/raminit.h @@ -30,6 +30,7 @@ int mctRead_SPD(u32 smaddr, u32 reg); void mctSMBhub_Init(u32 node); void mctGet_DIMMAddr(struct DCTStatStruc *pDCTstat, u32 node); void set_sysinfo_in_ram(u32 val); +struct sys_info *get_sysinfo(void); void raminit_amdmct(struct sys_info *sysinfo); void amdmct_cbmem_store_info(struct sys_info *sysinfo); void fill_mem_ctrl(u32 controllers, struct mem_controller *ctrl_a, const u8 *spd_addr); diff --git a/src/northbridge/amd/amdfam10/raminit_amdmct.c b/src/northbridge/amd/amdfam10/raminit_amdmct.c index 1f2b51d8bf..440a02635b 100644 --- a/src/northbridge/amd/amdfam10/raminit_amdmct.c +++ b/src/northbridge/amd/amdfam10/raminit_amdmct.c @@ -29,7 +29,12 @@ /* Global allocation of sysinfo_car */ #include -struct sys_info sysinfo_car CAR_GLOBAL; +static struct sys_info sysinfo_car CAR_GLOBAL; + +struct sys_info *get_sysinfo(void) +{ + return car_get_var_ptr(&sysinfo_car); +} struct mem_controller; extern int spd_read_byte(unsigned int device, unsigned int address); -- cgit v1.2.3