diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/cpu/i386/call64.S | 4 | ||||
-rw-r--r-- | arch/x86/cpu/i386/cpu.c | 31 | ||||
-rw-r--r-- | arch/x86/include/asm/arch-tangier/acpi/southcluster.asl | 87 | ||||
-rw-r--r-- | arch/x86/include/asm/string.h | 31 | ||||
-rw-r--r-- | arch/x86/lib/Makefile | 2 |
5 files changed, 125 insertions, 30 deletions
diff --git a/arch/x86/cpu/i386/call64.S b/arch/x86/cpu/i386/call64.S index 8f86728d42..275063c4af 100644 --- a/arch/x86/cpu/i386/call64.S +++ b/arch/x86/cpu/i386/call64.S @@ -79,6 +79,10 @@ lret_target: mov %eax, %eax /* Clear bits 63:32 */ jmp *%eax /* Jump to the 64-bit target */ +.globl call64_stub_size +call64_stub_size: + .long . - cpu_call64 + .data .align 16 .globl gdt64 diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c index 208ef08562..3bde44ebf5 100644 --- a/arch/x86/cpu/i386/cpu.c +++ b/arch/x86/cpu/i386/cpu.c @@ -462,6 +462,7 @@ int cpu_has_64bit(void) has_long_mode(); } +#define PAGETABLE_BASE 0x80000 #define PAGETABLE_SIZE (6 * 4096) /** @@ -522,33 +523,21 @@ int cpu_jump_to_64bit_uboot(ulong target) typedef void (*func_t)(ulong pgtable, ulong setup_base, ulong target); uint32_t *pgtable; func_t func; + char *ptr; - /* TODO(sjg@chromium.org): Find a better place for this */ - pgtable = (uint32_t *)0x1000000; - if (!pgtable) - return -ENOMEM; + pgtable = (uint32_t *)PAGETABLE_BASE; build_pagetable(pgtable); - /* TODO(sjg@chromium.org): Find a better place for this */ - char *ptr = (char *)0x3000000; - char *gdt = (char *)0x3100000; - - extern char gdt64[]; - - memcpy(ptr, cpu_call64, 0x1000); - memcpy(gdt, gdt64, 0x100); + extern long call64_stub_size; + ptr = malloc(call64_stub_size); + if (!ptr) { + printf("Failed to allocate the cpu_call64 stub\n"); + return -ENOMEM; + } + memcpy(ptr, cpu_call64, call64_stub_size); - /* - * TODO(sjg@chromium.org): This manually inserts the pointers into - * the code. Tidy this up to avoid this. - */ func = (func_t)ptr; - ulong ofs = (ulong)cpu_call64 - (ulong)ptr; - *(ulong *)(ptr + 7) = (ulong)gdt; - *(ulong *)(ptr + 0xc) = (ulong)gdt + 2; - *(ulong *)(ptr + 0x13) = (ulong)gdt; - *(ulong *)(ptr + 0x117 - 0xd4) -= ofs; /* * Copy U-Boot from ROM diff --git a/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl b/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl index e166e510cb..baad98b1c7 100644 --- a/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl +++ b/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl @@ -320,6 +320,93 @@ Device (PCI0) }) } } + + Device (IPC1) + { + Name (_ADR, 0x00130000) + + Method (_STA, 0, NotSerialized) + { + Return (STA_VISIBLE) + } + + Device (PMIC) + { + Name (_ADR, Zero) + Name (_HID, "INTC100E") + Name (_CID, "INTC100E") + Name (_DDN, "Basin Cove PMIC") + Name (_DEP, Package () + { + IPC1 + }) + + Method (_STA, 0, NotSerialized) + { + Return (STA_VISIBLE) + } + + Method (_CRS, 0, Serialized) + { + Name (RBUF, ResourceTemplate() + { + /* + * Shadow registers in SRAM for PMIC: + * SRAM PMIC register + * -------------------- + * 0x00- Unknown + * 0x03 THRMIRQ (0x04) + * 0x04 BCUIRQ (0x05) + * 0x05 ADCIRQ (0x06) + * 0x06 CHGRIRQ0 (0x07) + * 0x07 CHGRIRQ1 (0x08) + * 0x08- Unknown + * 0x0a PBSTATUS (0x27) + * 0x0b- Unknown + */ + Memory32Fixed(ReadWrite, 0xFFFFF610, 0x00000010) + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 30 } + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 23 } + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 52 } + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 51 } + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 50 } + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 27 } + Interrupt(ResourceConsumer, Level, ActiveHigh, Shared, ,, ) { 49 } + }) + Return (RBUF) + } + + OperationRegion (PMOP, 0x8D, Zero, 0x0100) + Field (PMOP, DWordAcc, NoLock, Preserve) + { + SEL1, 32, + SEL2, 32, + VCCL, 32, + VNNL, 32, + AONL, 32, + CNTC, 32, + CNTN, 32, + AONN, 32, + CNT1, 32, + CNT2, 32, + CNT3, 32, + FLEX, 32, + PRG1, 32, + PRG2, 32, + PRG3, 32, + VLDO, 32, + } + + Name (AVBL, Zero) + Method (_REG, 2, NotSerialized) + { + If ((Arg0 == 0x8D)) + { + AVBL = Arg1 + } + } + } + } } Device (FLIS) diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h index 38afd23684..c15b264a5c 100644 --- a/arch/x86/include/asm/string.h +++ b/arch/x86/include/asm/string.h @@ -9,22 +9,37 @@ extern char *strncpy(char *__dest, __const__ char *__src, __kernel_size_t __n); #undef __HAVE_ARCH_STRRCHR -extern char * strrchr(const char * s, int c); +extern char *strrchr(const char *s, int c); #undef __HAVE_ARCH_STRCHR -extern char * strchr(const char * s, int c); +extern char *strchr(const char *s, int c); + +#ifdef CONFIG_X86_64 + +#undef __HAVE_ARCH_MEMCPY +extern void *memcpy(void *, const void *, __kernel_size_t); + +#undef __HAVE_ARCH_MEMMOVE +extern void *memmove(void *, const void *, __kernel_size_t); + +#undef __HAVE_ARCH_MEMSET +extern void *memset(void *, int, __kernel_size_t); + +#else #define __HAVE_ARCH_MEMCPY -extern void * memcpy(void *, const void *, __kernel_size_t); +extern void *memcpy(void *, const void *, __kernel_size_t); #define __HAVE_ARCH_MEMMOVE -extern void * memmove(void *, const void *, __kernel_size_t); - -#undef __HAVE_ARCH_MEMCHR -extern void * memchr(const void *, int, __kernel_size_t); +extern void *memmove(void *, const void *, __kernel_size_t); #define __HAVE_ARCH_MEMSET -extern void * memset(void *, int, __kernel_size_t); +extern void *memset(void *, int, __kernel_size_t); + +#endif /* CONFIG_X86_64 */ + +#undef __HAVE_ARCH_MEMCHR +extern void *memchr(const void *, int, __kernel_size_t); #undef __HAVE_ARCH_MEMZERO extern void memzero(void *ptr, __kernel_size_t n); diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 1e8efcc44f..56fd680033 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -7,6 +7,7 @@ ifndef CONFIG_X86_64 obj-y += bios.o obj-y += bios_asm.o obj-y += bios_interrupts.o +obj-y += string.o endif ifndef CONFIG_SPL_BUILD obj-$(CONFIG_CMD_BOOTM) += bootm.o @@ -32,7 +33,6 @@ obj-$(CONFIG_X86_RAMTEST) += ramtest.o obj-$(CONFIG_INTEL_MID) += scu.o obj-y += sections.o obj-y += sfi.o -obj-y += string.o obj-y += acpi.o obj-$(CONFIG_HAVE_ACPI_RESUME) += acpi_s3.o ifndef CONFIG_QEMU |