summaryrefslogtreecommitdiff
path: root/src/soc/intel/quark/northcluster.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-06-25 13:02:55 +0300
committerFelix Held <felix-coreboot@felixheld.de>2022-07-05 13:07:08 +0000
commit5c3cbcd8cc6b2cc23e468983dc8299189c75d4ea (patch)
tree794e2a6ab5259e7579fecbd3816d4569b9eac5c9 /src/soc/intel/quark/northcluster.c
parent772ca3cc005125a2cbe0731493929041e61c20cb (diff)
soc/intel/baytrail,braswell,quark: Drop RES_IN_KIB
Change-Id: I2360a1a79f07ff8466ed01aa7f180d410e019292 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55926 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc/intel/quark/northcluster.c')
-rw-r--r--src/soc/intel/quark/northcluster.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/soc/intel/quark/northcluster.c b/src/soc/intel/quark/northcluster.c
index af4dd2449e..f1e5c634f5 100644
--- a/src/soc/intel/quark/northcluster.c
+++ b/src/soc/intel/quark/northcluster.c
@@ -6,21 +6,15 @@
#include <soc/iomap.h>
#include <soc/ramstage.h>
-#define RES_IN_KIB(r) ((r) >> 10)
-
static void nc_read_resources(struct device *dev)
{
- unsigned long base_k;
int index = 0;
- unsigned long size_k;
/* Read standard PCI resources. */
pci_dev_read_resources(dev);
/* 0 -> 0xa0000 */
- base_k = 0;
- size_k = 0xa0000 - base_k;
- ram_resource_kb(dev, index++, RES_IN_KIB(base_k), RES_IN_KIB(size_k));
+ ram_from_to(dev, index++, 0, 0xa0000);
/*
* Reserve everything between A segment and 1MB:
@@ -29,30 +23,18 @@ static void nc_read_resources(struct device *dev)
* 0xc0000 - 0xdffff: RAM
* 0xe0000 - 0xfffff: ROM shadow
*/
- base_k += size_k;
- size_k = 0xc0000 - base_k;
- mmio_resource_kb(dev, index++, RES_IN_KIB(base_k), RES_IN_KIB(size_k));
+ mmio_from_to(dev, index++, 0xa0000, 0xc0000);
- base_k += size_k;
- size_k = 0x100000 - base_k;
- reserved_ram_resource_kb(dev, index++, RES_IN_KIB(base_k),
- RES_IN_KIB(size_k));
+ reserved_ram_from_to(dev, index++, 0xc0000, 1 * MiB);
/* 0x100000 -> cbmem_top - cacheable and usable */
- base_k += size_k;
- size_k = (unsigned long)cbmem_top() - base_k;
- ram_resource_kb(dev, index++, RES_IN_KIB(base_k), RES_IN_KIB(size_k));
+ ram_from_to(dev, index++, 1 * MiB, (uintptr_t)cbmem_top());
/* cbmem_top -> 0xc0000000 - reserved */
- base_k += size_k;
- size_k = 0xc0000000 - base_k;
- reserved_ram_resource_kb(dev, index++, RES_IN_KIB(base_k),
- RES_IN_KIB(size_k));
+ reserved_ram_from_to(dev, index++, (uintptr_t)cbmem_top(), 0xc0000000);
/* 0xc0000000 -> 4GiB is mmio. */
- base_k += size_k;
- size_k = 0x100000000ull - base_k;
- mmio_resource_kb(dev, index++, RES_IN_KIB(base_k), RES_IN_KIB(size_k));
+ mmio_from_to(dev, index++, 0xc0000000, 4ull * GiB);
}
static struct device_operations nc_ops = {