nb/amd/{agesa,pi}: Clean up some math expressions
Change-Id: Id6a1a6123dc0e2afd04213ece13363eed29f92c0 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55930 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Martin L Roth <martinroth@google.com>
This commit is contained in:
parent
5213b193c7
commit
9d8df30950
|
@ -552,12 +552,12 @@ static void domain_set_resources(struct device *dev)
|
||||||
basek, limitk, sizek);
|
basek, limitk, sizek);
|
||||||
|
|
||||||
/* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */
|
/* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */
|
||||||
if ((basek < 640) && (sizek > 768)) {
|
if (basek < 640 && sizek > 768) {
|
||||||
printk(BIOS_DEBUG,"adsr - 0xa0000 to 0xbffff resource.\n");
|
printk(BIOS_DEBUG,"adsr - 0xa0000 to 0xbffff resource.\n");
|
||||||
ram_resource(dev, (idx | 0), basek, 640 - basek);
|
ram_resource(dev, (idx | 0), basek, 640 - basek);
|
||||||
idx += 0x10;
|
idx += 0x10;
|
||||||
basek = 768;
|
basek = 768;
|
||||||
sizek = limitk - 768;
|
sizek = limitk - basek;
|
||||||
}
|
}
|
||||||
|
|
||||||
printk(BIOS_DEBUG,
|
printk(BIOS_DEBUG,
|
||||||
|
|
|
@ -710,11 +710,11 @@ static void domain_set_resources(struct device *dev)
|
||||||
sizek = limitk - basek;
|
sizek = limitk - basek;
|
||||||
|
|
||||||
/* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */
|
/* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */
|
||||||
if ((basek < ((8*64)+(8*16))) && (sizek > ((8*64)+(16*16)))) {
|
if (basek < 640 && sizek > 768) {
|
||||||
ram_resource(dev, (idx | i), basek, ((8*64)+(8*16)) - basek);
|
ram_resource(dev, (idx | i), basek, 640 - basek);
|
||||||
idx += 0x10;
|
idx += 0x10;
|
||||||
basek = (8*64)+(16*16);
|
basek = 768;
|
||||||
sizek = limitk - ((8*64)+(16*16));
|
sizek = limitk - basek;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -722,11 +722,11 @@ static void domain_set_resources(struct device *dev)
|
||||||
sizek = limitk - basek;
|
sizek = limitk - basek;
|
||||||
|
|
||||||
/* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */
|
/* See if we need a hole from 0xa0000 (640K) to 0xbffff (768K) */
|
||||||
if ((basek < ((8*64)+(8*16))) && (sizek > ((8*64)+(16*16)))) {
|
if (basek < 640 && sizek > 768) {
|
||||||
ram_resource(dev, (idx | i), basek, ((8*64)+(8*16)) - basek);
|
ram_resource(dev, (idx | i), basek, 640 - basek);
|
||||||
idx += 0x10;
|
idx += 0x10;
|
||||||
basek = (8*64)+(16*16);
|
basek = 768;
|
||||||
sizek = limitk - ((8*64)+(16*16));
|
sizek = limitk - basek;
|
||||||
}
|
}
|
||||||
|
|
||||||
//printk(BIOS_DEBUG, "node %d : mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n", i, mmio_basek, basek, limitk);
|
//printk(BIOS_DEBUG, "node %d : mmio_basek=%08lx, basek=%08llx, limitk=%08llx\n", i, mmio_basek, basek, limitk);
|
||||||
|
|
|
@ -811,10 +811,10 @@ static void domain_read_resources(struct device *dev)
|
||||||
i, basek, limitk, sizek);
|
i, basek, limitk, sizek);
|
||||||
|
|
||||||
/* See if we need a hole from 0xa0000 (640K) to 0xfffff (1024K) */
|
/* See if we need a hole from 0xa0000 (640K) to 0xfffff (1024K) */
|
||||||
if ((basek < (0xa0000 >> 10) && (sizek > (0x100000 >> 10)))) {
|
if (basek < 640 && sizek > 1024) {
|
||||||
ram_resource(dev, (idx | i), basek, (0xa0000 >> 10) - basek);
|
ram_resource(dev, (idx | i), basek, 640 - basek);
|
||||||
idx += 0x10;
|
idx += 0x10;
|
||||||
basek = 0x100000 >> 10;
|
basek = 1024;
|
||||||
sizek = limitk - basek;
|
sizek = limitk - basek;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue