diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2017-12-28 01:48:09 +0100 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2018-05-16 06:19:34 +0000 |
commit | d8ec973fd24e091d0038d7060bfb516bad7534f0 (patch) | |
tree | 0945e83c1648cf6dc10569d863543b01de4362e8 /src/northbridge/via/vx900/northbridge.c | |
parent | faafbfb81e28df373d3319a6378e73cb37c9ced3 (diff) |
vx900: Move to EARLY_CBMEM_INIT
To calculate the CBMEM address we need to determine the framebuffer
size early in the ROMSTAGE. We now do the calculation before
cbmem_recovery() and configure the memory controller right away.
If the calculation was done from cbmem_top() instead, we'd loose some
logging that seems useful, since printk() would recurse to cbmem_top() too
with CONSOLE_CBMEM enabled.
If we didn't configure the memory controller at this point, we'd
need to store the result somewhere else. However, CAR_GLOBAL is not
practical at this point, because calling car_get_var() from cbmem_top()
would recurse back to cbmem_top().
Change-Id: Ib9ae0f97f9f769a20a610f8d76f14165fb924042
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-on: https://review.coreboot.org/25798
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/northbridge/via/vx900/northbridge.c')
-rw-r--r-- | src/northbridge/via/vx900/northbridge.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/northbridge/via/vx900/northbridge.c b/src/northbridge/via/vx900/northbridge.c index bf6cb660a0..3f839c7f72 100644 --- a/src/northbridge/via/vx900/northbridge.c +++ b/src/northbridge/via/vx900/northbridge.c @@ -245,7 +245,7 @@ static void vx900_set_resources(device_t dev) printk(BIOS_SPEW, "Found top of memory at %dMB\n", tomk >> 10); /* Do the same for top of low RAM */ - vx900_tolm = (pci_read_config16(mcu, 0x84) & 0xfff0) >> 4; + vx900_tolm = vx900_get_tolm(); full_tolmk = vx900_tolm << (20 - 10); /* Remap above 4G if needed */ full_tolmk = MIN(full_tolmk, pci_tolm >> 10); @@ -253,7 +253,7 @@ static void vx900_set_resources(device_t dev) full_tolmk >> 10); /* What about the framebuffer for the integrated GPU? */ - fbufk = chrome9hd_fb_size() >> 10; + fbufk = vx900_get_chrome9hd_fb_size() << (20 - 10); printk(BIOS_SPEW, "Integrated graphics buffer: %dMB\n", fbufk >> 10); /* Can't use the framebuffer as system RAM, sorry */ @@ -279,8 +279,6 @@ static void vx900_set_resources(device_t dev) if (tor) ram_resource(dev, idx++, RAM_4GB >> 10, (tor - RAM_4GB) >> 10); - set_late_cbmem_top(tolmk << 10); - printk(BIOS_DEBUG, "======================================================\n"); assign_resources(dev->link_list); } |