summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r--arch/x86/include/asm/acpi_table.h2
-rw-r--r--arch/x86/include/asm/bootparam.h3
-rw-r--r--arch/x86/include/asm/byteorder.h17
-rw-r--r--arch/x86/include/asm/cpu.h12
-rw-r--r--arch/x86/include/asm/fsp/fsp_hob.h4
-rw-r--r--arch/x86/include/asm/global_data.h9
-rw-r--r--arch/x86/include/asm/mp.h3
-rw-r--r--arch/x86/include/asm/mpspec.h10
-rw-r--r--arch/x86/include/asm/posix_types.h5
-rw-r--r--arch/x86/include/asm/sfi.h2
-rw-r--r--arch/x86/include/asm/spl.h8
-rw-r--r--arch/x86/include/asm/tables.h2
-rw-r--r--arch/x86/include/asm/types.h5
13 files changed, 62 insertions, 20 deletions
diff --git a/arch/x86/include/asm/acpi_table.h b/arch/x86/include/asm/acpi_table.h
index caff4d8a1e..bbd80a1dd9 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/bootparam.h b/arch/x86/include/asm/bootparam.h
index a373a79886..48b138c6b0 100644
--- a/arch/x86/include/asm/bootparam.h
+++ b/arch/x86/include/asm/bootparam.h
@@ -117,7 +117,8 @@ enum {
X86_SUBARCH_PC = 0,
X86_SUBARCH_LGUEST,
X86_SUBARCH_XEN,
- X86_SUBARCH_MRST,
+ X86_SUBARCH_INTEL_MID,
+ X86_SUBARCH_CE4100,
X86_NR_SUBARCHS,
};
#endif /* _ASM_X86_BOOTPARAM_H */
diff --git a/arch/x86/include/asm/byteorder.h b/arch/x86/include/asm/byteorder.h
index 7dfeb8bbed..a2d1fd8703 100644
--- a/arch/x86/include/asm/byteorder.h
+++ b/arch/x86/include/asm/byteorder.h
@@ -8,24 +8,25 @@
static __inline__ __u32 ___arch__swab32(__u32 x)
{
-#ifdef CONFIG_X86_BSWAP
__asm__("bswap %0" : "=r" (x) : "0" (x));
-#else
- __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
- "rorl $16,%0\n\t" /* swap words */
- "xchgb %b0,%h0" /* swap higher bytes */
- :"=q" (x)
- : "0" (x));
-#endif
+
return x;
}
+#define _constant_swab16(x) ((__u16)( \
+ (((__u16)(x) & (__u16)0x00ffU) << 8) | \
+ (((__u16)(x) & (__u16)0xff00U) >> 8)))
+
static __inline__ __u16 ___arch__swab16(__u16 x)
{
+#if CONFIG_IS_ENABLED(X86_64)
+ return _constant_swab16(x);
+#else
__asm__("xchgb %b0,%h0" /* swap bytes */ \
: "=q" (x) \
: "0" (x)); \
return x;
+#endif
}
#define __arch__swab32(x) ___arch__swab32(x)
diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index 540024a859..c651f2f594 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -159,6 +159,8 @@ static inline unsigned int cpuid_edx(unsigned int op)
return edx;
}
+#if !CONFIG_IS_ENABLED(X86_64)
+
/* Standard macro to see if a specific flag is changeable */
static inline int flag_is_changeable_p(uint32_t flag)
{
@@ -179,6 +181,7 @@ static inline int flag_is_changeable_p(uint32_t flag)
: "ir" (flag));
return ((f1^f2) & flag) != 0;
}
+#endif
static inline void mfence(void)
{
@@ -261,6 +264,15 @@ void cpu_call32(ulong code_seg32, ulong target, ulong table);
int cpu_jump_to_64bit(ulong setup_base, ulong target);
/**
+ * cpu_jump_to_64bit_uboot() - special function to jump from SPL to U-Boot
+ *
+ * This handles calling from 32-bit SPL to 64-bit U-Boot.
+ *
+ * @target: Address of U-Boot in RAM
+ */
+int cpu_jump_to_64bit_uboot(ulong target);
+
+/**
* cpu_get_family_model() - Get the family and model for the CPU
*
* @return the CPU ID masked with 0x0fff0ff0
diff --git a/arch/x86/include/asm/fsp/fsp_hob.h b/arch/x86/include/asm/fsp/fsp_hob.h
index 3fb3546e27..7c22bcd5cd 100644
--- a/arch/x86/include/asm/fsp/fsp_hob.h
+++ b/arch/x86/include/asm/fsp/fsp_hob.h
@@ -139,7 +139,7 @@ struct hob_guid {
*/
static inline const struct hob_header *get_next_hob(const struct hob_header *hdr)
{
- return (const struct hob_header *)((u32)hdr + hdr->len);
+ return (const struct hob_header *)((uintptr_t)hdr + hdr->len);
}
/**
@@ -172,7 +172,7 @@ static inline bool end_of_hob(const struct hob_header *hdr)
*/
static inline void *get_guid_hob_data(const struct hob_header *hdr)
{
- return (void *)((u32)hdr + sizeof(struct hob_guid));
+ return (void *)((uintptr_t)hdr + sizeof(struct hob_guid));
}
/**
diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h
index 7434f779b6..4570bc7a4a 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -93,6 +93,8 @@ struct arch_global_data {
char *mrc_output;
unsigned int mrc_output_len;
ulong table; /* Table pointer from previous loader */
+ int turbo_state; /* Current turbo state */
+ struct irq_routing_table *pirq_routing_table;
#ifdef CONFIG_SEABIOS
u32 high_table_ptr;
u32 high_table_limit;
@@ -104,8 +106,9 @@ struct arch_global_data {
#include <asm-generic/global_data.h>
#ifndef __ASSEMBLY__
-# ifdef CONFIG_EFI_APP
+# if defined(CONFIG_EFI_APP) || CONFIG_IS_ENABLED(X86_64)
+/* TODO(sjg@chromium.org): Consider using a fixed register for gd on x86_64 */
#define gd global_data_ptr
#define DECLARE_GLOBAL_DATA_PTR extern struct global_data *global_data_ptr
@@ -114,7 +117,11 @@ static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
{
gd_t *gd_ptr;
+#if CONFIG_IS_ENABLED(X86_64)
+ asm volatile("fs mov 0, %0\n" : "=r" (gd_ptr));
+#else
asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
+#endif
return gd_ptr;
}
diff --git a/arch/x86/include/asm/mp.h b/arch/x86/include/asm/mp.h
index 2e6c3120c7..83b99dcd19 100644
--- a/arch/x86/include/asm/mp.h
+++ b/arch/x86/include/asm/mp.h
@@ -90,4 +90,7 @@ int mp_init(struct mp_params *params);
/* Probes the CPU device */
int mp_init_cpu(struct udevice *cpu, void *unused);
+/* Set up additional CPUs */
+int x86_mp_init(void);
+
#endif /* _X86_MP_H_ */
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index ad8eba947b..30dbdca90d 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -224,9 +224,9 @@ struct mp_ext_compat_address_space {
* @mc: configuration table header address
* @return: configuration table end address
*/
-static inline u32 mp_next_mpc_entry(struct mp_config_table *mc)
+static inline ulong mp_next_mpc_entry(struct mp_config_table *mc)
{
- return (u32)mc + mc->mpc_length;
+ return (ulong)mc + mc->mpc_length;
}
/**
@@ -254,9 +254,9 @@ static inline void mp_add_mpc_entry(struct mp_config_table *mc, uint length)
* @mc: configuration table header address
* @return: configuration table end address
*/
-static inline u32 mp_next_mpe_entry(struct mp_config_table *mc)
+static inline ulong mp_next_mpe_entry(struct mp_config_table *mc)
{
- return (u32)mc + mc->mpc_length + mc->mpe_length;
+ return (ulong)mc + mc->mpc_length + mc->mpe_length;
}
/**
@@ -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/posix_types.h b/arch/x86/include/asm/posix_types.h
index 5529f32702..717f6cb8e0 100644
--- a/arch/x86/include/asm/posix_types.h
+++ b/arch/x86/include/asm/posix_types.h
@@ -16,8 +16,13 @@ typedef int __kernel_pid_t;
typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
+#if CONFIG_IS_ENABLED(X86_64)
+typedef unsigned long __kernel_size_t;
+typedef long __kernel_ssize_t;
+#else
typedef unsigned int __kernel_size_t;
typedef int __kernel_ssize_t;
+#endif
typedef int __kernel_ptrdiff_t;
typedef long __kernel_time_t;
typedef long __kernel_suseconds_t;
diff --git a/arch/x86/include/asm/sfi.h b/arch/x86/include/asm/sfi.h
index d1f0f0cb6b..d6c44c978a 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/spl.h b/arch/x86/include/asm/spl.h
new file mode 100644
index 0000000000..d48a3fcb74
--- /dev/null
+++ b/arch/x86/include/asm/spl.h
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2017 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * This file is required for SPL to build, but is empty.
+ */
diff --git a/arch/x86/include/asm/tables.h b/arch/x86/include/asm/tables.h
index 81f98f2774..d1b2388021 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/include/asm/types.h b/arch/x86/include/asm/types.h
index 880dcb488a..a47e581fe3 100644
--- a/arch/x86/include/asm/types.h
+++ b/arch/x86/include/asm/types.h
@@ -44,7 +44,12 @@ typedef __INT64_TYPE__ s64;
typedef __UINT64_TYPE__ u64;
#endif
+#if CONFIG_IS_ENABLED(X86_64)
+#define BITS_PER_LONG 64
+#else
#define BITS_PER_LONG 32
+#endif
+
/* Dma addresses are 32-bits wide. */
typedef u32 dma_addr_t;