A bunch of additional EPIA-M700 cleanups and also some non-cosmetic changes:

- Make get_dsdt script executable.

 - Rename DrivingClkPhaseData.c to driving_clk_phase_data.c.

 - Set proper IRQ_SLOT_COUNT value in the hope that the '14' from irq_table.c
   is correct.

 - Fix broken or incorrect #include names to increase likelyhood of a
   successful compile.
 
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4350 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Uwe Hermann 2009-06-07 14:38:32 +00:00
parent 0ffff3434e
commit d64f403f8e
7 changed files with 151 additions and 131 deletions

View File

@ -120,7 +120,7 @@ default CONFIG_UDELAY_TSC = 1
default CONFIG_TSC_X86RDTSC_CALIBRATE_WITH_TIMER2 = 1 default CONFIG_TSC_X86RDTSC_CALIBRATE_WITH_TIMER2 = 1
default HAVE_HARD_RESET = 0 default HAVE_HARD_RESET = 0
default HAVE_PIRQ_TABLE = 0 default HAVE_PIRQ_TABLE = 0
default IRQ_SLOT_COUNT = 10 # FIXME. irq_table.c says 14. default IRQ_SLOT_COUNT = 14
default HAVE_ACPI_TABLES = 1 default HAVE_ACPI_TABLES = 1
default HAVE_OPTION_TABLE = 1 default HAVE_OPTION_TABLE = 1
default ROM_IMAGE_SIZE = 128 * 1024 default ROM_IMAGE_SIZE = 128 * 1024

View File

@ -48,12 +48,12 @@
#include "cpu/x86/lapic/boot_cpu.c" #include "cpu/x86/lapic/boot_cpu.c"
/* This file contains the board-special SI value for raminit.c. */ /* This file contains the board-special SI value for raminit.c. */
#include "mainboard/via/6413e/DrivingClkPhaseData.c" #include "driving_clk_phase_data.c"
#include "northbridge/via/vx800/raminit.h" #include "northbridge/via/vx800/raminit.h"
#include "northbridge/via/vx800/raminit.c" #include "northbridge/via/vx800/raminit.c"
#include "cpu/x86/car/copy_and_run.c" #include "cpu/x86/car/copy_and_run.c"
#include "mainboard/via/6413e/wakeup.h" #include "wakeup.h"
/* /*
* This acpi_is_wakeup_early_via_VX800 is from Rudolf's patch on the list: * This acpi_is_wakeup_early_via_VX800 is from Rudolf's patch on the list:
@ -248,7 +248,8 @@ static const struct VIA_PCI_REG_INIT_TABLE mNbStage1InitTbl[] = {
0x00, 0xFF, NB_HOST_REG(0x84), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 0) 0x00, 0xFF, NB_HOST_REG(0x84), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 0)
0x00, 0xFF, NB_HOST_REG(0x85), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 1) 0x00, 0xFF, NB_HOST_REG(0x85), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 1)
0x00, 0xFF, NB_HOST_REG(0x86), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 2) 0x00, 0xFF, NB_HOST_REG(0x86), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 2)
0x00, 0xFF, NB_HOST_REG(0x87), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 3) */ 0x00, 0xFF, NB_HOST_REG(0x87), 0xFF, 0x44, // Host Data / Strobe CKG Control (Group 3)
*/
// CPU Host Bus Control // CPU Host Bus Control
0x00, 0xFF, NB_HOST_REG(0x50), 0x1F, 0x08, // Request phase ctrl: Dynamic Defer Snoop Stall Count = 8 0x00, 0xFF, NB_HOST_REG(0x50), 0x1F, 0x08, // Request phase ctrl: Dynamic Defer Snoop Stall Count = 8
@ -285,7 +286,7 @@ static const struct VIA_PCI_REG_INIT_TABLE mNbStage1InitTbl[] = {
#define gCom1Base 0x3f8 #define gCom1Base 0x3f8
#define gCom2Base 0x2f8 #define gCom2Base 0x2f8
void EmbedComInit() void EmbedComInit(void)
{ {
u8 ByteVal; u8 ByteVal;
u16 ComBase; u16 ComBase;
@ -351,9 +352,7 @@ void EmbedComInit()
//noharddrive //noharddrive
/* Set embedded COM1 I/O base = 0x3E8 */ /* Set embedded COM1 I/O base = 0x3E8 (D17F0RB4, ByteVal = 0xFD) */
//D17F0RB4
//ByteVal = 0xFD;
if (USE_COM1 == 1) { if (USE_COM1 == 1) {
ByteVal = (u8) ((gCom1Base >> 3) | 0x80); ByteVal = (u8) ((gCom1Base >> 3) | 0x80);
pci_write_config8(PCI_DEV(0, 17, 0), 0xB4, ByteVal); pci_write_config8(PCI_DEV(0, 17, 0), 0xB4, ByteVal);
@ -362,9 +361,7 @@ void EmbedComInit()
pci_write_config8(PCI_DEV(0, 17, 0), 0xB2, ByteVal); pci_write_config8(PCI_DEV(0, 17, 0), 0xB2, ByteVal);
} }
/* Set embedded COM2 I/O base = 0x2E8. */ /* Set embedded COM2 I/O base = 0x2E8 (D17F0RB5, ByteVal = 0xDD). */
//D17F0RB5
//ByteVal = 0xDD;
if (USE_COM2 == 1) { if (USE_COM2 == 1) {
ByteVal = (u8) ((gCom2Base >> 3) | 0x80); ByteVal = (u8) ((gCom2Base >> 3) | 0x80);
pci_write_config8(PCI_DEV(0, 17, 0), 0xB5, ByteVal); pci_write_config8(PCI_DEV(0, 17, 0), 0xB5, ByteVal);

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "northbridge/via/vx800/DrivingClkPhaseData.h" #include "northbridge/via/vx800/driving_clk_phase_data.h"
// DQS Driving // DQS Driving
// Reg0xE0, 0xE1 // Reg0xE0, 0xE1

0
src/mainboard/via/epia-m700/get_dsdt Normal file → Executable file
View File

View File

@ -23,7 +23,7 @@
const struct irq_routing_table intel_irq_routing_table = { const struct irq_routing_table intel_irq_routing_table = {
PIRQ_SIGNATURE, /* u32 signature */ PIRQ_SIGNATURE, /* u32 signature */
PIRQ_VERSION, /* u16 version */ PIRQ_VERSION, /* u16 version */
32 + 16 * 14, /* There can be total 14 devices on the bus */ 32 + 16 * IRQ_SLOT_COUNT,/* Max. number of devices on the bus */
0x00, /* Where the interrupt router lies (bus) */ 0x00, /* Where the interrupt router lies (bus) */
(0x11 << 3) | 0x0, /* Where the interrupt router lies (dev) */ (0x11 << 3) | 0x0, /* Where the interrupt router lies (dev) */
0xc20, /* IRQs devoted exclusively to PCI usage */ 0xc20, /* IRQs devoted exclusively to PCI usage */

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
/* reboot.c from Linux. */ /* Parts of this code is taken from reboot.c from Linux. */
/* /*
* This file mostly copied from Rudolf's S3 patch, some changes in * This file mostly copied from Rudolf's S3 patch, some changes in
@ -57,12 +57,12 @@ struct Xgt_desc_struct {
unsigned short pad; unsigned short pad;
} __attribute__ ((packed)); } __attribute__ ((packed));
static struct Xgt_desc_struct static struct Xgt_desc_struct real_mode_gdt = {
real_mode_gdt = sizeof(real_mode_gdt_entries) - 1,
{ sizeof(real_mode_gdt_entries) - 1, (long)real_mode_gdt_entries }, (long)real_mode_gdt_entries
real_mode_idt = { },
0x3ff, 0}, no_idt = { real_mode_idt = {0x3ff, 0},
0, 0}; no_idt = { 0, 0 };
/* /*
* This is 16-bit protected mode code to disable paging and the cache, * This is 16-bit protected mode code to disable paging and the cache,
@ -112,9 +112,8 @@ static unsigned char show32[6] = {
void acpi_jump_wake(u32 vector) void acpi_jump_wake(u32 vector)
{ {
u32 tmp; u32 tmp, dwEip;
u16 tmpvector; u16 tmpvector;
u32 dwEip;
u8 Data; u8 Data;
struct Xgt_desc_struct *wake_thunk16_Xgt_desc; struct Xgt_desc_struct *wake_thunk16_Xgt_desc;
@ -137,7 +136,7 @@ void acpi_jump_wake(u32 vector)
jason_tsc_count_end(); jason_tsc_count_end();
unsigned long long *real_mode_gdt_entries_at_eseg; unsigned long long *real_mode_gdt_entries_at_eseg;
real_mode_gdt_entries_at_eseg = WAKE_THUNK16_GDT; //copy from real_mode_gdt_entries and change limition to 1M and data base to 0; real_mode_gdt_entries_at_eseg = WAKE_THUNK16_GDT; /* Copy from real_mode_gdt_entries and change limition to 1M and data base to 0; */
real_mode_gdt_entries_at_eseg[0] = 0x0000000000000000ULL; /* Null descriptor */ real_mode_gdt_entries_at_eseg[0] = 0x0000000000000000ULL; /* Null descriptor */
real_mode_gdt_entries_at_eseg[1] = 0x000f9a000000ffffULL; /* 16-bit real-mode 1M code at 0x00000000 */ real_mode_gdt_entries_at_eseg[1] = 0x000f9a000000ffffULL; /* 16-bit real-mode 1M code at 0x00000000 */
real_mode_gdt_entries_at_eseg[2] = 0x000f93000000ffffULL; /* 16-bit real-mode 1M data at 0x00000000 */ real_mode_gdt_entries_at_eseg[2] = 0x000f93000000ffffULL; /* 16-bit real-mode 1M data at 0x00000000 */
@ -150,24 +149,25 @@ void acpi_jump_wake(u32 vector)
wake_thunk16_Xgt_desc[2].size = 0; wake_thunk16_Xgt_desc[2].size = 0;
wake_thunk16_Xgt_desc[2].address = 0; wake_thunk16_Xgt_desc[2].address = 0;
/*added this code to get current value of EIP /* Added this code to get current value of EIP. */
*/ __asm__ volatile (
__asm__ volatile ("calll geip\n\t" "calll geip\n\t"
"geip: \n\t" "popl %0\n\t":"=a" (dwEip) "geip: \n\t"
"popl %0\n\t"
: "=a" (dwEip)
); );
unsigned char *dest; unsigned char *dest, *src;
unsigned char *src;
src = (unsigned char *)dwEip; src = (unsigned char *)dwEip;
dest = WAKE_RECOVER1M_CODE; dest = WAKE_RECOVER1M_CODE;
u32 i; u32 i;
for (i = 0; i < 0x200; i++) for (i = 0; i < 0x200; i++)
dest[i] = src[i]; dest[i] = src[i];
__asm__ __volatile__("ljmp $0x0010,%0" //08 error __asm__ __volatile__("ljmp $0x0010,%0" /* 08 error */
::"i"((void *)(WAKE_RECOVER1M_CODE + 0x20))); ::"i"((void *)(WAKE_RECOVER1M_CODE + 0x20)));
/*added 0x20 "nop" to make sure the ljmp will not jump then halt */ /* Added 0x20 "nop" to make sure the ljmp will not jump then halt. */
asm volatile ("nop"); asm volatile ("nop");
asm volatile ("nop"); asm volatile ("nop");
asm volatile ("nop"); asm volatile ("nop");
@ -202,54 +202,68 @@ void acpi_jump_wake(u32 vector)
asm volatile ("nop"); asm volatile ("nop");
__asm__ volatile ( __asm__ volatile (
/* set new esp, maybe ebp should not equal to esp?, /*
due to the variable in acpi_jump_wake?, anyway, this may be not a big problem. * Set new esp, maybe ebp should not equal to esp?, due to the
and I didnt clear the area (ef000+-0x200) to zero. * variable in acpi_jump_wake?, anyway, this may be not a big
* problem. and I didn't clear the area (ef000+-0x200) to zero.
*/ */
"movl %0, %%ebp\n\t" "movl %0, %%ebp\n\t"
"movl %0, %%esp\n\t"::"a" (WAKE_THUNK16_STACK) "movl %0, %%esp\n\t"::"a" (WAKE_THUNK16_STACK)
); );
/* added this /*
only "src" and "dest" use the new stack, and the esp maybe also used in resumevector * Only "src" and "dest" use the new stack, and the esp maybe also
* used in resumevector.
*/ */
#if PAYLOAD_IS_SEABIOS == 1 #if PAYLOAD_IS_SEABIOS == 1
// WAKE_MEM_INFO inited in get_set_top_available_mem in tables.c /* WAKE_MEM_INFO inited in get_set_top_available_mem in tables.c. */
src = src =
(unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 - 0x100000); (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 - 0x100000);
dest = 0; dest = 0;
for (i = 0; i < 0xa0000; i++) //if recovered 0-e0000, then when resume, before winxp turn on the desktop screen ,there is gray background which last 1sec.
/*
* If recovered 0-e0000, then when resume, before WinXP turn on the
* desktop screen, there is gray background which last 1sec.
*/
for (i = 0; i < 0xa0000; i++)
dest[i] = src[i]; dest[i] = src[i];
/*__asm__ volatile (
#if 0
__asm__ volatile (
"movl %0, %%esi\n\t" "movl %0, %%esi\n\t"
"movl $0, %%edi\n\t" "movl $0, %%edi\n\t"
"movl $0xa0000, %%ecx\n\t" "movl $0xa0000, %%ecx\n\t"
"shrl $2, %%ecx\n\t" "shrl $2, %%ecx\n\t"
"rep movsd\n\t" "rep movsd\n\t"
::"a"(src) ::"a"(src)
);*/ );
src = #endif
(unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 - 0x100000 + src = (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024
0xc0000); - 0x100000 + 0xc0000);
//dest = 0xc0000;
//for (i = 0; i < 0x20000; i++) #if 0
// dest[i] = src[i]; dest = 0xc0000;
/* __asm__ volatile ( for (i = 0; i < 0x20000; i++)
dest[i] = src[i];
__asm__ volatile (
"movl %0, %%esi\n\t" "movl %0, %%esi\n\t"
"movl $0xc0000, %%edi\n\t" "movl $0xc0000, %%edi\n\t"
"movl $0x20000, %%ecx\n\t" "movl $0x20000, %%ecx\n\t"
"shrl $2, %%ecx\n\t" "shrl $2, %%ecx\n\t"
"rep movsd\n\t" "rep movsd\n\t"
::"a"(src) ::"a"(src)
); */ );
#endif
src = src = (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024
(unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 - 0x100000 + - 0x100000 + 0xe0000 + WAKE_SPECIAL_SIZE);
0xe0000 + WAKE_SPECIAL_SIZE);
//dest = 0xf0000; /* dest = 0xf0000; */
//for (i = 0; i < 0x10000; i++) /* for (i = 0; i < 0x10000; i++) */
// dest[i] = src[i]; /* dest[i] = src[i]; */
__asm__ volatile ("movl %0, %%esi\n\t" __asm__ volatile (
"movl %0, %%esi\n\t"
"movl %1, %%edi\n\t" "movl %1, %%edi\n\t"
"movl %2, %%ecx\n\t" "movl %2, %%ecx\n\t"
"shrl $2, %%ecx\n\t" "shrl $2, %%ecx\n\t"
@ -258,13 +272,13 @@ void acpi_jump_wake(u32 vector)
"r"(0x10000 - WAKE_SPECIAL_SIZE) "r"(0x10000 - WAKE_SPECIAL_SIZE)
); );
src = src = (unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024
(unsigned char *)((*(u32 *) WAKE_MEM_INFO) - 64 * 1024 - 0x100000 + - 0x100000 + 0xf0000);
0xf0000); /* dest = 0xf0000; */
//dest = 0xf0000; /* for (i = 0; i < 0x10000; i++) */
//for (i = 0; i < 0x10000; i++) /* dest[i] = src[i]; */
// dest[i] = src[i]; __asm__ volatile (
__asm__ volatile ("movl %0, %%esi\n\t" "movl %0, %%esi\n\t"
"movl $0xf0000, %%edi\n\t" "movl $0xf0000, %%edi\n\t"
"movl $0x10000, %%ecx\n\t" "movl $0x10000, %%ecx\n\t"
"shrl $2, %%ecx\n\t" "rep movsd\n\t"::"a" (src) "shrl $2, %%ecx\n\t" "rep movsd\n\t"::"a" (src)
@ -275,31 +289,39 @@ void acpi_jump_wake(u32 vector)
/* Set up the IDT for real mode. */ /* Set up the IDT for real mode. */
asm volatile ("lidt %0"::"m" (wake_thunk16_Xgt_desc[1])); asm volatile ("lidt %0"::"m" (wake_thunk16_Xgt_desc[1]));
/* Set up a GDT from which we can load segment descriptors for real /*
mode. The GDT is not used in real mode; it is just needed here to * Set up a GDT from which we can load segment descriptors for real
prepare the descriptors. */ * mode. The GDT is not used in real mode; it is just needed here to
* prepare the descriptors.
*/
asm volatile ("lgdt %0"::"m" (wake_thunk16_Xgt_desc[0])); asm volatile ("lgdt %0"::"m" (wake_thunk16_Xgt_desc[0]));
/* Load the data segment registers, and thus the descriptors ready for /*
real mode. The base address of each segment is 0x100, 16 times the * Load the data segment registers, and thus the descriptors ready for
selector value being loaded here. This is so that the segment * real mode. The base address of each segment is 0x100, 16 times the
registers don't have to be reloaded after switching to real mode: * selector value being loaded here. This is so that the segment
the values are consistent for real mode operation already. */ * registers don't have to be reloaded after switching to real mode:
* the values are consistent for real mode operation already.
__asm__ __volatile__("movl $0x0010,%%eax\n" */
__asm__ __volatile__(
"movl $0x0010,%%eax\n"
"\tmovl %%eax,%%ds\n" "\tmovl %%eax,%%ds\n"
"\tmovl %%eax,%%es\n" "\tmovl %%eax,%%es\n"
"\tmovl %%eax,%%fs\n" "\tmovl %%eax,%%fs\n"
"\tmovl %%eax,%%gs\n" "\tmovl %%eax,%%ss":::"eax"); "\tmovl %%eax,%%gs\n"
"\tmovl %%eax,%%ss":::"eax"
);
/* Jump to the 16-bit code that we copied earlier. It disables paging /*
and the cache, switches to real mode, and jumps to the BIOS reset * Jump to the 16-bit code that we copied earlier. It disables paging
entry point. */ * and the cache, switches to real mode, and jumps to the BIOS reset
* entry point.
*/
__asm__ __asm__ __volatile__(
__volatile__("ljmp $0x0008,%0"::"i" "ljmp $0x0008,%0"::"i"
((void *)(WAKE_THUNK16_ADDR - ((void *)(WAKE_THUNK16_ADDR - sizeof(real_mode_switch) - 100))
sizeof(real_mode_switch) - 100))); );
} }
/* -*- linux-c -*- ------------------------------------------------------- * /* -*- linux-c -*- ------------------------------------------------------- *
@ -429,6 +451,7 @@ int enable_a20(void)
/* Try enabling A20 through the keyboard controller */ /* Try enabling A20 through the keyboard controller */
empty_8042(); empty_8042();
// if (a20_test_short()) // if (a20_test_short())
// return 0; /* BIOS worked, but with delayed reaction */ // return 0; /* BIOS worked, but with delayed reaction */