summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-01-16 07:03:35 -0700
committerBin Meng <bmeng.cn@gmail.com>2017-02-06 11:38:46 +0800
commit42fd8c19b58fe8f8fe7559ea53b1cef12fc06240 (patch)
treeb06a899ecdd9ec87f8415518e98ed14e08832431 /arch
parent0ec28e026606fa579e9c8639f82843fb6a60337a (diff)
downloadu-boot-imx-42fd8c19b58fe8f8fe7559ea53b1cef12fc06240.zip
u-boot-imx-42fd8c19b58fe8f8fe7559ea53b1cef12fc06240.tar.gz
u-boot-imx-42fd8c19b58fe8f8fe7559ea53b1cef12fc06240.tar.bz2
x86: Use unsigned long for address in table generation
We should use unsigned long rather than u32 for addresses. Update this so that the table-generation code builds correctly on 64-bit machines. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/cpu/irq.c2
-rw-r--r--arch/x86/include/asm/acpi_table.h2
-rw-r--r--arch/x86/include/asm/mpspec.h2
-rw-r--r--arch/x86/include/asm/sfi.h2
-rw-r--r--arch/x86/include/asm/tables.h2
-rw-r--r--arch/x86/lib/acpi_table.c4
-rw-r--r--arch/x86/lib/mpspec.c2
-rw-r--r--arch/x86/lib/sfi.c6
-rw-r--r--arch/x86/lib/tables.c11
-rw-r--r--arch/x86/lib/zimage.c2
10 files changed, 14 insertions, 21 deletions
diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c
index 9364410..e3e928b 100644
--- a/arch/x86/cpu/irq.c
+++ b/arch/x86/cpu/irq.c
@@ -264,7 +264,7 @@ int irq_router_probe(struct udevice *dev)
return irq_router_common_init(dev);
}
-u32 write_pirq_routing_table(u32 addr)
+ulong write_pirq_routing_table(ulong addr)
{
if (!pirq_routing_table)
return addr;
diff --git a/arch/x86/include/asm/acpi_table.h b/arch/x86/include/asm/acpi_table.h
index caff4d8..bbd80a1 100644
--- a/arch/x86/include/asm/acpi_table.h
+++ b/arch/x86/include/asm/acpi_table.h
@@ -316,4 +316,4 @@ int acpi_create_madt_lapic_nmi(struct acpi_madt_lapic_nmi *lapic_nmi,
u8 cpu, u16 flags, u8 lint);
u32 acpi_fill_madt(u32 current);
void acpi_create_gnvs(struct acpi_global_nvs *gnvs);
-u32 write_acpi_tables(u32 start);
+ulong write_acpi_tables(ulong start);
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index ad8eba9..146a4b0 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -456,6 +456,6 @@ int mp_determine_pci_dstirq(int bus, int dev, int func, int pirq);
* @addr: start address to write MP table
* @return: end address of MP table
*/
-u32 write_mp_table(u32 addr);
+ulong write_mp_table(ulong addr);
#endif /* __ASM_MPSPEC_H */
diff --git a/arch/x86/include/asm/sfi.h b/arch/x86/include/asm/sfi.h
index d1f0f0c..d6c44c9 100644
--- a/arch/x86/include/asm/sfi.h
+++ b/arch/x86/include/asm/sfi.h
@@ -132,6 +132,6 @@ typedef int (*sfi_table_handler) (struct sfi_table_header *table);
* @base: Address to write table to
* @return address to use for the next table
*/
-u32 write_sfi_table(u32 base);
+ulong write_sfi_table(ulong base);
#endif /*_LINUX_SFI_H */
diff --git a/arch/x86/include/asm/tables.h b/arch/x86/include/asm/tables.h
index 81f98f2..d1b2388 100644
--- a/arch/x86/include/asm/tables.h
+++ b/arch/x86/include/asm/tables.h
@@ -65,6 +65,6 @@ void write_tables(void);
* @start: start address to write PIRQ routing table
* @return: end address of PIRQ routing table
*/
-u32 write_pirq_routing_table(u32 start);
+ulong write_pirq_routing_table(ulong start);
#endif /* _X86_TABLES_H_ */
diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c
index 7001e8b..355456d 100644
--- a/arch/x86/lib/acpi_table.c
+++ b/arch/x86/lib/acpi_table.c
@@ -327,7 +327,7 @@ static void enter_acpi_mode(int pm1_cnt)
* QEMU's version of write_acpi_tables is defined in
* arch/x86/cpu/qemu/acpi_table.c
*/
-u32 write_acpi_tables(u32 start)
+ulong write_acpi_tables(ulong start)
{
u32 current;
struct acpi_rsdp *rsdp;
@@ -345,7 +345,7 @@ u32 write_acpi_tables(u32 start)
/* Align ACPI tables to 16 byte */
current = ALIGN(current, 16);
- debug("ACPI: Writing ACPI tables at %x\n", start);
+ debug("ACPI: Writing ACPI tables at %lx\n", start);
/* We need at least an RSDP and an RSDT Table */
rsdp = (struct acpi_rsdp *)current;
diff --git a/arch/x86/lib/mpspec.c b/arch/x86/lib/mpspec.c
index 6ab43f1..516d7b3 100644
--- a/arch/x86/lib/mpspec.c
+++ b/arch/x86/lib/mpspec.c
@@ -365,7 +365,7 @@ static void mptable_add_lintsrc(struct mp_config_table *mc, int bus_isa)
bus_isa, 0, MP_APIC_ALL, 1);
}
-u32 write_mp_table(u32 addr)
+ulong write_mp_table(ulong addr)
{
struct mp_config_table *mc;
int ioapic_id, ioapic_ver;
diff --git a/arch/x86/lib/sfi.c b/arch/x86/lib/sfi.c
index 3d36580..507e037 100644
--- a/arch/x86/lib/sfi.c
+++ b/arch/x86/lib/sfi.c
@@ -38,14 +38,14 @@ static void *get_entry_start(struct table_info *tab)
tab->table[tab->count] = tab->entry_start;
tab->entry_start += sizeof(struct sfi_table_header);
- return (void *)tab->entry_start;
+ return (void *)(uintptr_t)tab->entry_start;
}
static void finish_table(struct table_info *tab, const char *sig, void *entry)
{
struct sfi_table_header *hdr;
- hdr = (struct sfi_table_header *)(tab->base + tab->ptr);
+ hdr = (struct sfi_table_header *)(uintptr_t)(tab->base + tab->ptr);
strcpy(hdr->sig, sig);
hdr->len = sizeof(*hdr) + ((ulong)entry - tab->entry_start);
hdr->rev = 1;
@@ -131,7 +131,7 @@ static int sfi_write_xsdt(struct table_info *tab)
return 0;
}
-u32 write_sfi_table(u32 base)
+ulong write_sfi_table(ulong base)
{
struct table_info table;
diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c
index 5966e58..4f5fe74 100644
--- a/arch/x86/lib/tables.c
+++ b/arch/x86/lib/tables.c
@@ -12,20 +12,13 @@
#include <asm/acpi_table.h>
#include <asm/coreboot_tables.h>
-#ifdef CONFIG_GENERATE_SMBIOS_TABLE
-static u32 write_smbios_table_wrapper(u32 addr)
-{
- return write_smbios_table(addr);
-}
-#endif
-
/**
* Function prototype to write a specific configuration table
*
* @addr: start address to write the table
* @return: end address of the table
*/
-typedef u32 (*table_write)(u32 addr);
+typedef ulong (*table_write)(ulong addr);
static table_write table_write_funcs[] = {
#ifdef CONFIG_GENERATE_PIRQ_TABLE
@@ -41,7 +34,7 @@ static table_write table_write_funcs[] = {
write_acpi_tables,
#endif
#ifdef CONFIG_GENERATE_SMBIOS_TABLE
- write_smbios_table_wrapper,
+ write_smbios_table,
#endif
};
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index 1b33c77..b6b0f2b 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -165,7 +165,7 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size,
* A very old kernel MUST have its real-mode code
* loaded at 0x90000
*/
- if ((u32)setup_base != 0x90000) {
+ if ((ulong)setup_base != 0x90000) {
/* Copy the real-mode kernel */
memmove((void *)0x90000, setup_base, setup_size);