diff options
author | Elyes HAOUAS <ehaouas@noos.fr> | 2022-01-14 18:56:49 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-01-25 16:14:23 +0000 |
commit | 964055d74f6db71607e8fc36ca352fde05f4b6ee (patch) | |
tree | f602b7d475e50fd99c8366935dc1e03e003f6003 /src/northbridge | |
parent | 6ec3dd2e5c31eb94f9ef4212975ad6fff0d88826 (diff) |
northbridge/intel/i945: Change types to uintptr_t where appropriate
Prepares compilation for x86_64 by avoiding casts to different sizes.
Current patch fixes:
1.
src/northbridge/intel/i945/raminit.c: In function 'ram_read32':
src/northbridge/intel/i945/raminit.c:77:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
77 | read32((void *)offset);
| ^
2.
src/northbridge/intel/i945/rcven.c: In function 'sample_strobes':
src/northbridge/intel/i945/rcven.c:29:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
29 | read32((void *)addr);
| ^
src/northbridge/intel/i945/rcven.c:30:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
30 | read32((void *)(addr + 0x80));
| ^
3.
src/northbridge/intel/i945/gma.c: In function 'intel_gma_init_lvds':
src/northbridge/intel/i945/gma.c:98:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
98 | (void *)pgfx, mmiobase, piobase, pphysbase);
| ^
src/northbridge/intel/i945/gma.c:359:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
359 | (void *)pgfx, hactive * vactive * 4);
| ^
src/northbridge/intel/i945/gma.c:360:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
360 | memset((void *)pgfx, 0x00, hactive * vactive * 4);
| ^
src/northbridge/intel/i945/gma.c: In function 'intel_gma_init_vga':
src/northbridge/intel/i945/gma.c:384:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
384 | (u32)mmiobase, piobase, pphysbase);
|
4.
src/northbridge/intel/i945/northbridge.c: In function 'mch_domain_read_resources':
src/northbridge/intel/i945/northbridge.c:64:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
64 | cbmem_topk = ((uint32_t)cbmem_top() / KiB);
| ^
Change-Id: I5ac7a1cb5d85a346114f909047d5a7c21ddb43e9
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61117
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/northbridge')
-rw-r--r-- | src/northbridge/intel/i945/gma.c | 8 | ||||
-rw-r--r-- | src/northbridge/intel/i945/northbridge.c | 2 | ||||
-rw-r--r-- | src/northbridge/intel/i945/raminit.c | 2 | ||||
-rw-r--r-- | src/northbridge/intel/i945/rcven.c | 3 |
4 files changed, 8 insertions, 7 deletions
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c index 0d014fbaf1..99d3c21e36 100644 --- a/src/northbridge/intel/i945/gma.c +++ b/src/northbridge/intel/i945/gma.c @@ -73,7 +73,7 @@ static int gtt_setup(u8 *mmiobase) static int intel_gma_init_lvds(struct northbridge_intel_i945_config *conf, unsigned int pphysbase, unsigned int piobase, - u8 *mmiobase, unsigned int pgfx) + u8 *mmiobase, uintptr_t pgfx) { struct edid edid; struct edid_mode *mode; @@ -373,15 +373,15 @@ static int intel_gma_init_lvds(struct northbridge_intel_i945_config *conf, static int intel_gma_init_vga(struct northbridge_intel_i945_config *conf, unsigned int pphysbase, unsigned int piobase, - u8 *mmiobase, unsigned int pgfx) + u8 *mmiobase, uintptr_t pgfx) { int i; u32 hactive, vactive; u16 reg16; u32 uma_size; - printk(BIOS_SPEW, "mmiobase %x addrport %x physbase %x\n", - (u32)mmiobase, piobase, pphysbase); + printk(BIOS_SPEW, "mmiobase %lx addrport %x physbase %x\n", + (uintptr_t)mmiobase, piobase, pphysbase); gtt_setup(mmiobase); diff --git a/src/northbridge/intel/i945/northbridge.c b/src/northbridge/intel/i945/northbridge.c index e1e35e9b67..6c055e9ffe 100644 --- a/src/northbridge/intel/i945/northbridge.c +++ b/src/northbridge/intel/i945/northbridge.c @@ -61,7 +61,7 @@ static void mch_domain_read_resources(struct device *dev) /* cbmem_top can be shifted downwards due to alignment. Mark the region between cbmem_top and tomk as unusable */ - cbmem_topk = ((uint32_t)cbmem_top() / KiB); + cbmem_topk = ((uintptr_t)cbmem_top() / KiB); delta_cbmem = tomk_stolen - cbmem_topk; tomk_stolen -= delta_cbmem; diff --git a/src/northbridge/intel/i945/raminit.c b/src/northbridge/intel/i945/raminit.c index 566d3e7755..e168f7ce94 100644 --- a/src/northbridge/intel/i945/raminit.c +++ b/src/northbridge/intel/i945/raminit.c @@ -70,7 +70,7 @@ static __attribute__((noinline)) void do_ram_command(u32 command) udelay(1); } -static void ram_read32(u32 offset) +static void ram_read32(uintptr_t offset) { PRINTK_DEBUG(" RAM read: %08x\n", offset); diff --git a/src/northbridge/intel/i945/rcven.c b/src/northbridge/intel/i945/rcven.c index b95170f7c5..ca54bad7f8 100644 --- a/src/northbridge/intel/i945/rcven.c +++ b/src/northbridge/intel/i945/rcven.c @@ -10,7 +10,8 @@ */ static u32 sample_strobes(int channel_offset, struct sys_info *sysinfo) { - u32 reg32, addr; + u32 reg32; + uintptr_t addr; int i; mchbar_setbits32(C0DRC1 + channel_offset, 1 << 6); |