summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-05-13 12:21:06 -0700
committerAaron Durbin <adurbin@chromium.org>2020-05-14 21:27:26 +0000
commitd6973e811b925901e045f3f229a45c16d8dcbcca (patch)
tree482d0800f26930bba9ac12ab78c73ed363c7ae0c /src
parentbcac1cbacd2613e02c865182f445a02e6cdf45e7 (diff)
downloadcoreboot-d6973e811b925901e045f3f229a45c16d8dcbcca.tar.xz
soc/samsung/exynos5250: add resources during read_resources()
The chipset code was incorrectly adding memory resources to the domain device after resource allocation occurred. It's not possible to get the correct view of the address space, and it's generally incorrect to not add resources during read_resources(). This change fixes the order by adding resources in read_resources(). Signed-off-by: Furquan Shaikh <furquan@google.com> Change-Id: I419be7edf289636b24b9a7d6c390866ade638de3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/41373 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/samsung/exynos5250/cpu.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/soc/samsung/exynos5250/cpu.c b/src/soc/samsung/exynos5250/cpu.c
index 514e451ede..6a0251d36f 100644
--- a/src/soc/samsung/exynos5250/cpu.c
+++ b/src/soc/samsung/exynos5250/cpu.c
@@ -95,14 +95,20 @@ static void cpu_enable(struct device *dev)
unsigned long fb_size = FB_SIZE_KB * KiB;
u32 lcdbase = get_fb_base_kb() * KiB;
- ram_resource(dev, 0, RAM_BASE_KB, RAM_SIZE_KB - FB_SIZE_KB);
- mmio_resource(dev, 1, lcdbase / KiB, DIV_ROUND_UP(fb_size, KiB));
-
exynos_displayport_init(dev, lcdbase, fb_size);
set_cpu_id();
}
+static void cpu_read_resources(struct device *dev)
+{
+ unsigned long fb_size = FB_SIZE_KB * KiB;
+ u32 lcdbase = get_fb_base_kb() * KiB;
+
+ ram_resource(dev, 0, RAM_BASE_KB, RAM_SIZE_KB - FB_SIZE_KB);
+ mmio_resource(dev, 1, lcdbase / KiB, DIV_ROUND_UP(fb_size, KiB));
+}
+
static void cpu_init(struct device *dev)
{
printk(BIOS_INFO, "CPU: S5P%X @ %ldMHz\n",
@@ -110,7 +116,7 @@ static void cpu_init(struct device *dev)
}
static struct device_operations cpu_ops = {
- .read_resources = noop_read_resources,
+ .read_resources = cpu_read_resources,
.set_resources = noop_set_resources,
.enable_resources = cpu_enable,
.init = cpu_init,