Intel E7501 P64H2 ICH5R support
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1616 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
7dea9552d5
commit
70093f7875
|
@ -1,5 +1,10 @@
|
|||
uses INTEL_PPRO_MTRR
|
||||
uses CPU_FIXUP
|
||||
dir /cpu/p5
|
||||
object cpufixup.o
|
||||
config chip.h
|
||||
if CPU_FIXUP
|
||||
object cpufixup.o
|
||||
object apic_timer.o
|
||||
end
|
||||
object mtrr.o
|
||||
object pgtbl.o
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
#include <stdint.h>
|
||||
#include <delay.h>
|
||||
#include <cpu/p6/msr.h>
|
||||
#include <cpu/p6/apic.h>
|
||||
|
||||
void init_timer(void)
|
||||
{
|
||||
/* Set the apic timer to no interrupts and periodic mode */
|
||||
apic_write(APIC_LVTT, (1 << 17)|(1<< 16)|(0 << 12)|(0 << 0));
|
||||
/* Set the divider to 1, no divider */
|
||||
apic_write(APIC_TDCR, APIC_TDR_DIV_1);
|
||||
/* Set the initial counter to 0xffffffff */
|
||||
apic_write(APIC_TMICT, 0xffffffff);
|
||||
}
|
||||
|
||||
void udelay(unsigned usecs)
|
||||
{
|
||||
uint32_t start, value, ticks;
|
||||
/* Calculate the number of ticks to run, our FSB runs a 200Mhz */
|
||||
ticks = usecs * 200;
|
||||
start = apic_read(APIC_TMCCT);
|
||||
do {
|
||||
value = apic_read(APIC_TMCCT);
|
||||
} while((start - value) < ticks);
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
extern struct chip_control cpu_p6_control;
|
||||
|
||||
struct cpu_p6_config {
|
||||
int nothing;
|
||||
};
|
|
@ -351,3 +351,27 @@ void p6_cpufixup(struct mem_range *mem)
|
|||
printk_debug("Updating microcode\n");
|
||||
display_cpuid_update_microcode();
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
void p6_enable(struct chip *chip, enum chip_pass pass)
|
||||
{
|
||||
|
||||
struct cpu_p6_config *conf = (struct cpu_p6_config *)chip->chip_info;
|
||||
|
||||
switch (pass) {
|
||||
case CONF_PASS_PRE_CONSOLE:
|
||||
break;
|
||||
case CONF_PASS_PRE_PCI:
|
||||
init_timer();
|
||||
break;
|
||||
default:
|
||||
/* nothing yet */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
struct chip_control cpu_p6_control = {
|
||||
.enable = p6_enable,
|
||||
.name = "Intel P6 CPU",
|
||||
};
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/* Clear out an mmx state */
|
||||
emms
|
||||
|
||||
/*
|
||||
* Put the processor back into a reset state
|
||||
* with respect to the xmm registers.
|
||||
*/
|
||||
|
||||
pxor %xmm0, %xmm0
|
||||
pxor %xmm1, %xmm1
|
||||
pxor %xmm2, %xmm2
|
||||
pxor %xmm3, %xmm3
|
||||
pxor %xmm4, %xmm4
|
||||
pxor %xmm5, %xmm5
|
||||
pxor %xmm6, %xmm6
|
||||
pxor %xmm7, %xmm7
|
||||
|
||||
/* Disable floating point emulation */
|
||||
movl %cr0, %eax
|
||||
andl $~(1<<2), %eax
|
||||
movl %eax, %cr0
|
||||
|
||||
/* Disable sse instructions */
|
||||
movl %cr4, %eax
|
||||
andl $~(3<<9), %eax
|
||||
movl %eax, %cr4
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
/* Save the BIST result */
|
||||
movl %eax, %ebp
|
||||
|
||||
/*
|
||||
* Enabling mmx registers is a noop
|
||||
* Enable the use of the xmm registers
|
||||
*/
|
||||
|
||||
/* Enable sse instructions */
|
||||
movl %cr4, %eax
|
||||
orl $(1<<9), %eax
|
||||
movl %eax, %cr4
|
||||
|
||||
/* Disable floating point emulation */
|
||||
movl %cr0, %eax
|
||||
andl $~(1<<2), %eax
|
||||
movl %eax, %cr0
|
||||
|
||||
/* enable sse extension */
|
||||
movl %cr0, %eax
|
||||
andl $~(1<<1), %eax
|
||||
movl %eax, %cr0
|
||||
|
||||
/* Restore the BIST result */
|
||||
movl %ebp, %eax
|
|
@ -1890,6 +1890,20 @@
|
|||
#define PCI_DEVICE_ID_INTEL_82801CA_1F5 0x2485
|
||||
#define PCI_DEVICE_ID_INTEL_82801CA_1D2 0x2487
|
||||
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1E0 0x244e
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1F0 0x24d0
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1F1 0x24db
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1F2 0x24d1
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1F2_R 0x24df
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1F3 0x24d3
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1F5 0x24d5
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1F6 0x24d6
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1D0 0x24d2
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1D1 0x24d4
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1D2 0x24d7
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1D3 0x24de
|
||||
#define PCI_DEVICE_ID_INTEL_82801ER_1D7 0x24dd
|
||||
|
||||
#define PCI_DEVICE_ID_INTEL_82870_1E0 0x1461
|
||||
#define PCI_DEVICE_ID_INTEL_82870_1F0 0x1460
|
||||
|
||||
|
|
|
@ -0,0 +1,222 @@
|
|||
uses HAVE_MP_TABLE
|
||||
uses HAVE_PIRQ_TABLE
|
||||
uses USE_FALLBACK_IMAGE
|
||||
uses LB_CKS_RANGE_START
|
||||
uses LB_CKS_RANGE_END
|
||||
uses LB_CKS_LOC
|
||||
uses MAINBOARD
|
||||
uses ARCH
|
||||
uses HARD_RESET_BUS
|
||||
uses HARD_RESET_DEVICE
|
||||
uses HARD_RESET_FUNCTION
|
||||
#
|
||||
#
|
||||
###
|
||||
### Set all of the defaults for an x86 architecture
|
||||
###
|
||||
#
|
||||
#
|
||||
###
|
||||
### Build the objects we have code for in this directory.
|
||||
###
|
||||
##object mainboard.o
|
||||
config chip.h
|
||||
register "fixup_scsi" = "1"
|
||||
register "fixup_vga" = "1"
|
||||
|
||||
|
||||
##
|
||||
## Move the default LinuxBIOS cmos range off of AMD RTC registers
|
||||
##
|
||||
default LB_CKS_RANGE_START=49
|
||||
default LB_CKS_RANGE_END=122
|
||||
default LB_CKS_LOC=123
|
||||
|
||||
driver mainboard.o
|
||||
#dir /drvers/adaptec/7902
|
||||
#dir /drivers/si/3114
|
||||
#dir /drivers/intel/82551_ipmi
|
||||
#dir /drivers/ati/ragexl
|
||||
if HAVE_MP_TABLE object mptable.o end
|
||||
if HAVE_PIRQ_TABLE object irq_tables.o end
|
||||
#
|
||||
#default HARD_RESET_BUS=1
|
||||
#default HARD_RESET_DEVICE=4
|
||||
#default HARD_RESET_FUNCTION=0
|
||||
#
|
||||
arch i386 end
|
||||
#
|
||||
###
|
||||
### Build our 16 bit and 32 bit linuxBIOS entry code
|
||||
###
|
||||
mainboardinit cpu/i386/entry16.inc
|
||||
mainboardinit cpu/i386/entry32.inc
|
||||
mainboardinit cpu/i386/bist32.inc
|
||||
ldscript /cpu/i386/entry16.lds
|
||||
ldscript /cpu/i386/entry32.lds
|
||||
#
|
||||
###
|
||||
### Build our reset vector (This is where linuxBIOS is entered)
|
||||
###
|
||||
if USE_FALLBACK_IMAGE
|
||||
mainboardinit cpu/i386/reset16.inc
|
||||
ldscript /cpu/i386/reset16.lds
|
||||
else
|
||||
mainboardinit cpu/i386/reset32.inc
|
||||
ldscript /cpu/i386/reset32.lds
|
||||
end
|
||||
#
|
||||
#### Should this be in the northbridge code?
|
||||
mainboardinit arch/i386/lib/cpu_reset.inc
|
||||
#
|
||||
###
|
||||
### Include an id string (For safe flashing)
|
||||
###
|
||||
mainboardinit arch/i386/lib/id.inc
|
||||
ldscript /arch/i386/lib/id.lds
|
||||
#
|
||||
####
|
||||
#### This is the early phase of linuxBIOS startup
|
||||
#### Things are delicate and we test to see if we should
|
||||
#### failover to another image.
|
||||
####
|
||||
#option MAX_REBOOT_CNT=2
|
||||
if USE_FALLBACK_IMAGE
|
||||
ldscript /arch/i386/lib/failover.lds
|
||||
end
|
||||
#
|
||||
###
|
||||
### Setup our mtrrs
|
||||
###
|
||||
#mainboardinit cpu/p6/earlymtrr.inc
|
||||
###
|
||||
### Only the bootstrap cpu makes it here.
|
||||
### Failover if we need to
|
||||
###
|
||||
#
|
||||
if USE_FALLBACK_IMAGE
|
||||
mainboardinit ./failover.inc
|
||||
end
|
||||
|
||||
#
|
||||
#
|
||||
###
|
||||
### Setup the serial port
|
||||
###
|
||||
mainboardinit pc80/serial.inc
|
||||
mainboardinit arch/i386/lib/console.inc
|
||||
mainboardinit cpu/i386/bist32_fail.inc
|
||||
#
|
||||
####
|
||||
#### O.k. We aren't just an intermediary anymore!
|
||||
####
|
||||
#
|
||||
###
|
||||
### When debugging disable the watchdog timer
|
||||
###
|
||||
##option MAXIMUM_CONSOLE_LOGLEVEL=7
|
||||
#default MAXIMUM_CONSOLE_LOGLEVEL=7
|
||||
#
|
||||
#if USE_FALLBACK_IMAGE mainboardinit arch/i386/lib/noop_failover.inc end
|
||||
#
|
||||
###
|
||||
### Romcc output
|
||||
###
|
||||
|
||||
makerule ./failover.E
|
||||
depends "$(MAINBOARD)/failover.c"
|
||||
action "$(CPP) -I$(TOP)/src $(ROMCCPPFLAGS) $(CPPFLAGS) $(MAINBOARD)/failover.c > ./failover.E"
|
||||
end
|
||||
|
||||
makerule ./failover.inc
|
||||
depends "./romcc ./failover.E"
|
||||
action "./romcc -O -o failover.inc --label-prefix=failover ./failover.E"
|
||||
end
|
||||
|
||||
makerule ./auto.E
|
||||
depends "$(MAINBOARD)/auto.c option_table.h"
|
||||
action "$(CPP) -I$(TOP)/src -I. $(ROMCCPPFLAGS) $(CPPFLAGS) $(MAINBOARD)/auto.c > ./auto.E"
|
||||
end
|
||||
makerule ./auto.inc
|
||||
depends "./romcc ./auto.E"
|
||||
action "./romcc -O2 -mcpu=k8 -o auto.inc --label-prefix=auto ./auto.E"
|
||||
# action "./romcc -O2 ./auto.E > auto.inc"
|
||||
end
|
||||
mainboardinit cpu/p6/enable_mmx_sse.inc
|
||||
mainboardinit ./auto.inc
|
||||
mainboardinit cpu/p6/disable_mmx_sse.inc
|
||||
#
|
||||
###
|
||||
### Include the secondary Configuration files
|
||||
###
|
||||
|
||||
config chip.h
|
||||
|
||||
northbridge intel/e7501 "e7501"
|
||||
pci 0:2.0
|
||||
pci 0:0.0
|
||||
pci 0:0.1
|
||||
pci 0:6.0
|
||||
southbridge intel/i82870 "i82870"
|
||||
pci 0:1c.0
|
||||
pci 0:1d.0
|
||||
pci 0:1e.0
|
||||
pci 0:1f.0
|
||||
end
|
||||
end
|
||||
southbridge intel/i82801er "i82801er"
|
||||
pci 0:1f.0
|
||||
pci 0:1d.0 on
|
||||
pci 0:1d.1 on
|
||||
pci 0:1d.2 on
|
||||
pci 0:1d.3 on
|
||||
pci 0:1d.7 on
|
||||
pci 0:1e.0 on
|
||||
pci 0:1f.1 off
|
||||
pci 0:1f.2 on
|
||||
pci 0:1f.3 on
|
||||
pci 0:1f.5 off
|
||||
pci 0:1f.6 off
|
||||
# pci 1:8.0 off
|
||||
superio winbond/w83627hf
|
||||
pnp 2e.0 on # Floppy
|
||||
io 0x60 = 0x3f0
|
||||
irq 0x70 = 6
|
||||
drq 0x74 = 2
|
||||
pnp 2e.1 off # Parallel Port
|
||||
io 0x60 = 0x378
|
||||
irq 0x70 = 7
|
||||
pnp 2e.2 on # Com1
|
||||
io 0x60 = 0x3f8
|
||||
irq 0x70 = 4
|
||||
pnp 2e.3 off # Com2
|
||||
io 0x60 = 0x2f8
|
||||
irq 0x70 = 3
|
||||
pnp 2e.5 on # Keyboard
|
||||
io 0x60 = 0x60
|
||||
io 0x62 = 0x64
|
||||
irq 0x70 = 1
|
||||
irq 0x72 = 12
|
||||
pnp 2e.6 off # CIR
|
||||
pnp 2e.7 off # GAME_MIDI_GIPO1
|
||||
pnp 2e.8 off # GPIO2
|
||||
pnp 2e.9 off # GPIO3
|
||||
pnp 2e.a off # ACPI
|
||||
pnp 2e.b on # HW Monitor
|
||||
io 0x60 = 0x290
|
||||
end
|
||||
end
|
||||
#end
|
||||
dir /pc80
|
||||
#dir /bioscall
|
||||
cpu p6 "cpu0"
|
||||
end
|
||||
|
||||
cpu p6 "cpu1"
|
||||
end
|
||||
|
||||
cpu p6 "cpu2"
|
||||
end
|
||||
|
||||
cpu p6 "cpu3"
|
||||
end
|
|
@ -0,0 +1,135 @@
|
|||
#define ASSEMBLY 1
|
||||
#include <stdint.h>
|
||||
#include <device/pci_def.h>
|
||||
#include <arch/io.h>
|
||||
#include <device/pnp_def.h>
|
||||
#include <arch/romcc_io.h>
|
||||
#include <arch/smp/lapic.h>
|
||||
#include "option_table.h"
|
||||
#include "pc80/mc146818rtc_early.c"
|
||||
#include "pc80/serial.c"
|
||||
#include "arch/i386/lib/console.c"
|
||||
#include "ram/ramtest.c"
|
||||
#include "southbridge/intel/i82801er/i82801er_early_smbus.c"
|
||||
#include "northbridge/intel/e7501/raminit.h"
|
||||
|
||||
#if 1
|
||||
#include "cpu/p6/apic_timer.c"
|
||||
#include "lib/delay.c"
|
||||
#endif
|
||||
|
||||
#include "cpu/p6/boot_cpu.c"
|
||||
#include "northbridge/intel/e7501/debug.c"
|
||||
#include "superio/winbond/w83627hf/w83627hf_early_serial.c"
|
||||
|
||||
#include "cpu/p6/earlymtrr.c"
|
||||
|
||||
#define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
|
||||
|
||||
static void hard_reset(void)
|
||||
{
|
||||
outb(0x0e, 0x0cf9);
|
||||
}
|
||||
|
||||
static void memreset_setup(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void memreset(int controllers, const struct mem_controller *ctrl)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
static inline void activate_spd_rom(const struct mem_controller *ctrl)
|
||||
{
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
static inline int spd_read_byte(unsigned device, unsigned address)
|
||||
{
|
||||
return smbus_read_byte(device, address);
|
||||
}
|
||||
|
||||
#include "northbridge/intel/e7501/raminit.c"
|
||||
#include "northbridge/intel/e7501/reset_test.c"
|
||||
#include "sdram/generic_sdram.c"
|
||||
|
||||
static void main(void)
|
||||
{
|
||||
static const struct mem_controller memctrl[] = {
|
||||
{
|
||||
.d0 = PCI_DEV(0, 0, 0),
|
||||
.d0f1 = PCI_DEV(0, 0, 1),
|
||||
.channel0 = { (0xa<<3)|0, (0xa<<3)|1, (0xa<<3)|2, 0 },
|
||||
.channel1 = { (0xa<<3)|4, (0xa<<3)|5, (0xa<<3)|6, 0 },
|
||||
},
|
||||
};
|
||||
|
||||
#if 1
|
||||
enable_lapic();
|
||||
init_timer();
|
||||
#endif
|
||||
|
||||
w83627hf_enable_serial(SERIAL_DEV, TTYS0_BASE);
|
||||
uart_init();
|
||||
console_init();
|
||||
// setup_default_resource_map();
|
||||
#if 0
|
||||
print_pci_devices();
|
||||
#endif
|
||||
if(!bios_reset_detected()) {
|
||||
enable_smbus();
|
||||
#if 0
|
||||
// dump_spd_registers(&memctrl[0]);
|
||||
dump_smbus_registers();
|
||||
#endif
|
||||
|
||||
memreset_setup();
|
||||
sdram_initialize(sizeof(memctrl)/sizeof(memctrl[0]), memctrl);
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
/* clear memory 1meg */
|
||||
__asm__ volatile(
|
||||
"1: \n\t"
|
||||
"movl %0, %%fs:(%1)\n\t"
|
||||
"addl $4,%1\n\t"
|
||||
"subl $4,%2\n\t"
|
||||
"jnz 1b\n\t"
|
||||
:
|
||||
: "a" (0), "D" (0), "c" (1024*1024)
|
||||
);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
dump_pci_devices();
|
||||
#endif
|
||||
#if 0
|
||||
dump_pci_device(PCI_DEV(0, 0, 0));
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
msr_t msr;
|
||||
msr = rdmsr(TOP_MEM2);
|
||||
print_debug("TOP_MEM2: ");
|
||||
print_debug_hex32(msr.hi);
|
||||
print_debug_hex32(msr.lo);
|
||||
print_debug("\r\n");
|
||||
#endif
|
||||
/*
|
||||
#if 0
|
||||
ram_check(0x00000000, msr.lo+(msr.hi<<32));
|
||||
#else
|
||||
#if 0
|
||||
// Check 16MB of memory @ 0
|
||||
ram_check(0x00000000, 0x01000000);
|
||||
#else
|
||||
// Check 16MB of memory @ 2GB
|
||||
ram_check(0x80000000, 0x81000000);
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
extern struct chip_control mainboard_tyan_s2735_control;
|
||||
|
||||
struct mainboard_tyan_s2735_config {
|
||||
int fixup_scsi;
|
||||
int fixup_vga;
|
||||
};
|
|
@ -0,0 +1,96 @@
|
|||
entries
|
||||
|
||||
#start-bit length config config-ID name
|
||||
#0 8 r 0 seconds
|
||||
#8 8 r 0 alarm_seconds
|
||||
#16 8 r 0 minutes
|
||||
#24 8 r 0 alarm_minutes
|
||||
#32 8 r 0 hours
|
||||
#40 8 r 0 alarm_hours
|
||||
#48 8 r 0 day_of_week
|
||||
#56 8 r 0 day_of_month
|
||||
#64 8 r 0 month
|
||||
#72 8 r 0 year
|
||||
#80 4 r 0 rate_select
|
||||
#84 3 r 0 REF_Clock
|
||||
#87 1 r 0 UIP
|
||||
#88 1 r 0 auto_switch_DST
|
||||
#89 1 r 0 24_hour_mode
|
||||
#90 1 r 0 binary_values_enable
|
||||
#91 1 r 0 square-wave_out_enable
|
||||
#92 1 r 0 update_finished_enable
|
||||
#93 1 r 0 alarm_interrupt_enable
|
||||
#94 1 r 0 periodic_interrupt_enable
|
||||
#95 1 r 0 disable_clock_updates
|
||||
#96 288 r 0 temporary_filler
|
||||
0 384 r 0 reserved_memory
|
||||
384 1 e 4 boot_option
|
||||
385 1 e 4 last_boot
|
||||
386 1 e 1 ECC_memory
|
||||
388 4 r 0 reboot_bits
|
||||
392 3 e 5 baud_rate
|
||||
395 1 e 2 hyper_threading
|
||||
396 1 e 1 thermal_monitoring
|
||||
397 1 e 1 remap_memory_high
|
||||
400 1 e 1 power_on_after_fail
|
||||
412 4 e 6 debug_level
|
||||
416 4 e 7 boot_first
|
||||
420 4 e 7 boot_second
|
||||
424 4 e 7 boot_third
|
||||
428 4 h 0 boot_index
|
||||
432 8 h 0 boot_countdown
|
||||
#440 4 e 9 slow_cpu
|
||||
444 1 e 1 nmi
|
||||
728 256 h 0 user_data
|
||||
984 16 h 0 check_sum
|
||||
# Reserve the extended AMD configuration registers
|
||||
1000 24 r 0 reserved_memory
|
||||
|
||||
|
||||
|
||||
enumerations
|
||||
|
||||
#ID value text
|
||||
1 0 Disable
|
||||
1 1 Enable
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
5 0 115200
|
||||
5 1 57600
|
||||
5 2 38400
|
||||
5 3 19200
|
||||
5 4 9600
|
||||
5 5 4800
|
||||
5 6 2400
|
||||
5 7 1200
|
||||
6 6 Notice
|
||||
6 7 Info
|
||||
6 8 Debug
|
||||
6 9 Spew
|
||||
7 0 Network
|
||||
7 1 HDD
|
||||
7 2 Floppy
|
||||
7 8 Fallback_Network
|
||||
7 9 Fallback_HDD
|
||||
7 10 Fallback_Floppy
|
||||
#7 3 ROM
|
||||
#8 0 200Mhz
|
||||
#8 1 166Mhz
|
||||
#8 2 133Mhz
|
||||
#8 3 100Mhz
|
||||
#9 0 off
|
||||
#9 1 87.5%
|
||||
#9 2 75.0%
|
||||
#9 3 62.5%
|
||||
#9 4 50.0%
|
||||
#9 5 37.5%
|
||||
#9 6 25.0%
|
||||
#9 7 12.5%
|
||||
|
||||
checksums
|
||||
|
||||
checksum 392 983 984
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
#define ASSEMBLY 1
|
||||
#include <stdint.h>
|
||||
#include <device/pci_def.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <arch/io.h>
|
||||
#include <arch/romcc_io.h>
|
||||
#include <arch/smp/lapic.h>
|
||||
#include "pc80/mc146818rtc_early.c"
|
||||
#include "southbridge/intel/i82801er/cmos_failover.c"
|
||||
#include "cpu/p6/boot_cpu.c"
|
||||
#include "northbridge/intel/e7501/reset_test.c"
|
||||
|
||||
#define HAVE_REGPARM_SUPPORT 0
|
||||
#if HAVE_REGPARM_SUPPORT
|
||||
static unsigned long main(unsigned long bist)
|
||||
{
|
||||
#else
|
||||
static void main(void)
|
||||
{
|
||||
unsigned long bist = 0;
|
||||
|
||||
#endif
|
||||
/* Is this a deliberate reset by the bios */
|
||||
if (bios_reset_detected() && last_boot_normal()) {
|
||||
goto normal_image;
|
||||
}
|
||||
/* This is the primary cpu how should I boot? */
|
||||
else {
|
||||
|
||||
check_cmos_failed();
|
||||
|
||||
if (do_normal_boot()) {
|
||||
goto normal_image;
|
||||
}
|
||||
else {
|
||||
goto fallback_image;
|
||||
}
|
||||
}
|
||||
normal_image:
|
||||
asm volatile ("jmp __normal_image"
|
||||
: /* outputs */
|
||||
: "a" (bist) /* inputs */
|
||||
: /* clobbers */
|
||||
);
|
||||
#if 0
|
||||
cpu_reset:
|
||||
asm volatile ("jmp __cpu_reset"
|
||||
: /* outputs */
|
||||
: "a"(bist) /* inputs */
|
||||
: /* clobbers */
|
||||
);
|
||||
#endif
|
||||
fallback_image:
|
||||
#if HAVE_REGPARM_SUPPORT
|
||||
return bist;
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/* This file was generated by getpir.c, do not modify!
|
||||
(but if you do, please run checkpir on it to verify)
|
||||
Contains the IRQ Routing Table dumped directly from your memory , wich BIOS sets up
|
||||
|
||||
Documentation at : http://www.microsoft.com/hwdev/busbios/PCIIRQ.HTM
|
||||
*/
|
||||
|
||||
#include <arch/pirq_routing.h>
|
||||
|
||||
const struct irq_routing_table intel_irq_routing_table = {
|
||||
PIRQ_SIGNATURE, /* u32 signature */
|
||||
PIRQ_VERSION, /* u16 version */
|
||||
32+16*15, /* there can be total 15 devices on the bus */
|
||||
0x00, /* Where the interrupt router lies (bus) */
|
||||
(0x1f<<3)|0x0, /* Where the interrupt router lies (dev) */
|
||||
0, /* IRQs devoted exclusively to PCI usage */
|
||||
0x8086, /* Vendor */
|
||||
0x24d0, /* Device */
|
||||
0, /* Crap (miniport) */
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* u8 rfu[11] */
|
||||
0x9a, /* u8 checksum , this hase to set to some value that would give 0 after the sum of all bytes for this structure (including checksum) */
|
||||
{
|
||||
/* bus, dev|fn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */
|
||||
{0x04,(0x08<<3)|0x0, {{0x68, 0xdcf8}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
||||
{0x00,(0x1f<<3)|0x0, {{0x62, 0xdcf8}, {0x61, 0xdcf8}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
||||
{0x00,(0x1d<<3)|0x0, {{0x60, 0xdcf8}, {0x63, 0xdcf8}, {0x62, 0xdcf8}, {0x6b, 0x0dcf8}}, 0x0, 0x0},
|
||||
{0x04,(0x03<<3)|0x0, {{0x62, 0xdcf8}, {0x63, 0xdcf8}, {0x60, 0xdcf8}, {0x61, 0x0dcf8}}, 0x3, 0x0},
|
||||
{0x04,(0x02<<3)|0x0, {{0x62, 0xdcf8}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
||||
{0x03,(0x1f<<3)|0x0, {{0x60, 0xdcf8}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
||||
{0x02,(0x1f<<3)|0x0, {{0x60, 0xdcf8}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
||||
{0x03,(0x03<<3)|0x0, {{0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x60, 0x0dcf8}}, 0x1, 0x0},
|
||||
{0x03,(0x06<<3)|0x0, {{0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x60, 0x0dcf8}}, 0x2, 0x0},
|
||||
{0x02,(0x01<<3)|0x0, {{0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
||||
{0x02,(0x02<<3)|0x0, {{0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
||||
{0x04,(0x01<<3)|0x0, {{0x61, 0xdcf8}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
||||
{0x04,(0x04<<3)|0x0, {{0x63, 0xdcf8}, {0x60, 0xdcf8}, {0x61, 0xdcf8}, {0x62, 0x0dcf8}}, 0x4, 0x0},
|
||||
{0x03,(0x04<<3)|0x0, {{0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x60, 0x0dcf8}}, 0x5, 0x0},
|
||||
{0x03,(0x05<<3)|0x0, {{0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x60, 0xdcf8}, {0x60, 0x0dcf8}}, 0x6, 0x0},
|
||||
}
|
||||
};
|
|
@ -0,0 +1,183 @@
|
|||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/chip.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include "chip.h"
|
||||
//#include <part/mainboard.h>
|
||||
//#include "lsi_scsi.c"
|
||||
unsigned long initial_apicid[CONFIG_MAX_CPUS] =
|
||||
{
|
||||
0, 6, 1, 7
|
||||
};
|
||||
#if 0
|
||||
static void fixup_lsi_53c1030(struct device *pdev)
|
||||
{
|
||||
// uint8_t byte;
|
||||
uint16_t word;
|
||||
|
||||
byte = 1;
|
||||
pci_write_config8(pdev, 0xff, byte);
|
||||
// Set the device id
|
||||
// pci_write_config_word(pdev, PCI_DEVICE_ID, PCI_DEVICE_ID_LSILOGIC_53C1030);
|
||||
// Set the subsytem vendor id
|
||||
// pci_write_config16(pdev, PCI_SUBSYSTEM_VENDOR_ID, PCI_VENDOR_ID_TYAN);
|
||||
word = 0x10f1;
|
||||
pci_write_config16(pdev, PCI_SUBSYSTEM_VENDOR_ID, word);
|
||||
// Set the subsytem id
|
||||
word = 0x2880;
|
||||
pci_write_config16(pdev, PCI_SUBSYSTEM_ID, word);
|
||||
// Disable writes to the device id
|
||||
byte = 0;
|
||||
pci_write_config8(pdev, 0xff, byte);
|
||||
|
||||
// lsi_scsi_init(pdev);
|
||||
|
||||
}
|
||||
#endif
|
||||
//extern static void lsi_scsi_init(struct device *dev);
|
||||
#if 0
|
||||
static void print_pci_regs(struct device *dev)
|
||||
{
|
||||
uint8_t byte;
|
||||
int i;
|
||||
|
||||
for(i=0;i<256;i++) {
|
||||
byte = pci_read_config8(dev, i);
|
||||
|
||||
if((i%16)==0) printk_info("\n%02x:",i);
|
||||
printk_debug(" %02x",byte);
|
||||
}
|
||||
printk_debug("\n");
|
||||
|
||||
// pci_write_config8(dev, 0x4, byte);
|
||||
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
static void print_mem(void)
|
||||
{
|
||||
int i;
|
||||
int low_1MB = 0;
|
||||
for(i=low_1MB;i<low_1MB+1024*4;i++) {
|
||||
if((i%16)==0) printk_debug("\n %08x:",i);
|
||||
printk_debug(" %02x ",(unsigned char)*((unsigned char *)i));
|
||||
}
|
||||
|
||||
for(i=low_1MB;i<low_1MB+1024*4;i++) {
|
||||
if((i%16)==0) printk_debug("\n %08x:",i);
|
||||
printk_debug(" %c ",(unsigned char)*((unsigned char *)i));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
static void onboard_scsi_fixup(void)
|
||||
{
|
||||
struct device *dev;
|
||||
unsigned char i,j,k;
|
||||
#if 1
|
||||
for(i=0;i<=5;i++) {
|
||||
for(j=0;j<=0x1f;j++) {
|
||||
for (k=0;k<=6;k++){
|
||||
dev = dev_find_slot(i, PCI_DEVFN(j, k));
|
||||
if (dev) {
|
||||
printk_debug("%02x:%02x:%02x",i,j,k);
|
||||
print_pci_regs(dev);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
dev = dev_find_device(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,0);
|
||||
if(!dev) {
|
||||
printk_info("LSI_SCSI_FW_FIXUP: No Device Found!");
|
||||
return;
|
||||
}
|
||||
|
||||
lsi_scsi_init(dev);
|
||||
#endif
|
||||
// print_mem();
|
||||
// amd8111_enable_rom();
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
static void vga_fixup(void) {
|
||||
// we do this right here because:
|
||||
// - all the hardware is working, and some VGA bioses seem to need
|
||||
// that
|
||||
// - we need page 0 below for linuxbios tables.
|
||||
#if CONFIG_REALMODE_IDT == 1
|
||||
printk_debug("INSTALL REAL-MODE IDT\n");
|
||||
setup_realmode_idt();
|
||||
#endif
|
||||
#if CONFIG_VGABIOS == 1
|
||||
printk_debug("DO THE VGA BIOS\n");
|
||||
do_vgabios();
|
||||
post_code(0x93);
|
||||
#endif
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
static void
|
||||
enable(struct chip *chip, enum chip_pass pass)
|
||||
{
|
||||
|
||||
struct mainboard_tyan_s2735_config *conf =
|
||||
(struct mainboard_tyan_s2735_config *)chip->chip_info;
|
||||
|
||||
switch (pass) {
|
||||
default: break;
|
||||
// case CONF_PASS_PRE_CONSOLE:
|
||||
// case CONF_PASS_PRE_PCI:
|
||||
case CONF_PASS_POST_PCI:
|
||||
case CONF_PASS_PRE_BOOT:
|
||||
// if (conf->fixup_scsi)
|
||||
// onboard_scsi_fixup();
|
||||
// if (conf->fixup_vga)
|
||||
// vga_fixup();
|
||||
// printk_debug("mainboard fixup pass %d done\r\n",pass);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
mainboard_scan_bus(device_t root, int maxbus)
|
||||
{
|
||||
int retval;
|
||||
printk_spew("%s: root %p maxbus %d\n", __FUNCTION__, root, maxbus);
|
||||
retval = pci_scan_bus(root->bus, 0, 0xff, maxbus);
|
||||
printk_spew("DONE %s: return %d\n", __FUNCTION__, maxbus);
|
||||
return maxbus;
|
||||
}
|
||||
|
||||
static struct device_operations mainboard_operations = {
|
||||
.read_resources = root_dev_read_resources,
|
||||
.set_resources = root_dev_set_resources,
|
||||
.enable_resources = enable_childrens_resources,
|
||||
.init = 0,
|
||||
.scan_bus = mainboard_scan_bus,
|
||||
.enable = 0,
|
||||
};
|
||||
|
||||
static void enumerate(struct chip *chip)
|
||||
{
|
||||
struct chip *child;
|
||||
dev_root.ops = &mainboard_operations;
|
||||
chip->dev = &dev_root;
|
||||
chip->bus = 0;
|
||||
for(child = chip->children; child; child = child->next) {
|
||||
child->bus = &dev_root.link[0];
|
||||
}
|
||||
}
|
||||
struct chip_control mainboard_tyan_s2735_control = {
|
||||
.enable = enable,
|
||||
.enumerate = enumerate,
|
||||
.name = "Tyan s2735 mainboard ",
|
||||
};
|
||||
|
|
@ -0,0 +1,165 @@
|
|||
#include <console/console.h>
|
||||
#include <arch/smp/mpspec.h>
|
||||
#include <device/pci.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void *smp_write_config_table(void *v, unsigned long * processor_map)
|
||||
{
|
||||
static const char sig[4] = "PCMP";
|
||||
static const char oem[8] = "TYAN ";
|
||||
static const char productid[12] = "S2735 ";
|
||||
struct mp_config_table *mc;
|
||||
|
||||
mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
|
||||
memset(mc, 0, sizeof(*mc));
|
||||
|
||||
memcpy(mc->mpc_signature, sig, sizeof(sig));
|
||||
mc->mpc_length = sizeof(*mc); /* initially just the header */
|
||||
mc->mpc_spec = 0x04;
|
||||
mc->mpc_checksum = 0; /* not yet computed */
|
||||
memcpy(mc->mpc_oem, oem, sizeof(oem));
|
||||
memcpy(mc->mpc_productid, productid, sizeof(productid));
|
||||
mc->mpc_oemptr = 0;
|
||||
mc->mpc_oemsize = 0;
|
||||
mc->mpc_entry_count = 0; /* No entries yet... */
|
||||
mc->mpc_lapic = LAPIC_ADDR;
|
||||
mc->mpe_length = 0;
|
||||
mc->mpe_checksum = 0;
|
||||
mc->reserved = 0;
|
||||
|
||||
smp_write_processors(mc, processor_map);
|
||||
|
||||
|
||||
/*Bus: Bus ID Type*/
|
||||
smp_write_bus(mc, 0, "PCI ");
|
||||
smp_write_bus(mc, 1, "PCI ");
|
||||
smp_write_bus(mc, 2, "PCI ");
|
||||
smp_write_bus(mc, 3, "PCI ");
|
||||
smp_write_bus(mc, 4, "PCI ");
|
||||
smp_write_bus(mc, 5, "ISA ");
|
||||
/*I/O APICs: APIC ID Version State Address*/
|
||||
smp_write_ioapic(mc, 8, 0x20, 0xfec00000);
|
||||
{
|
||||
struct pci_dev *dev;
|
||||
uint32_t base;
|
||||
dev = dev_find_slot(1, PCI_DEVFN(0x1e,0));
|
||||
if (dev) {
|
||||
base = pci_read_config32(dev, PCI_BASE_ADDRESS_0);
|
||||
base &= PCI_BASE_ADDRESS_MEM_MASK;
|
||||
smp_write_ioapic(mc, 9, 0x20, base);
|
||||
}
|
||||
dev = dev_find_slot(1, PCI_DEVFN(0x1c,0));
|
||||
if (dev) {
|
||||
base = pci_read_config32(dev, PCI_BASE_ADDRESS_0);
|
||||
base &= PCI_BASE_ADDRESS_MEM_MASK;
|
||||
smp_write_ioapic(mc, 0xa, 0x20, base);
|
||||
}
|
||||
}
|
||||
/*I/O Ints: Type Polarity Trigger Bus ID IRQ APIC ID PIN#
|
||||
*/
|
||||
smp_write_intsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0x0, 0x8, 0x0);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0x1, 0x8, 0x1);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0x0, 0x8, 0x2);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0x3, 0x8, 0x3);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0x4, 0x8, 0x4);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0x6, 0x8, 0x6);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0x8, 0x8, 0x8);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0x9, 0x8, 0x9);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0xc, 0x8, 0xc);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0xd, 0x8, 0xd);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0xe, 0x8, 0xe);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x5, 0xf, 0x8, 0xf);
|
||||
//USB
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x0, 0x7c, 0x8, 0x12);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x0, 0x7d, 0x8, 0x11);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x0, 0x74, 0x8, 0x10);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x0, 0x75, 0x8, 0x13);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x0, 0x77, 0x8, 0x17);
|
||||
|
||||
//onboard ati
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, 0x8, 0x8, 0x12);
|
||||
|
||||
//onboard intel 82551 10/100
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, 0x4, 0x8, 0x11);
|
||||
|
||||
// onboard Intel 82547 1000
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x2, 0x4, 0xa, 0x0);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x2, 0x5, 0xa, 0x1);
|
||||
|
||||
//Slot 4
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, (0x3<<2)|0, 0x8, 0x12);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, (0x3<<2)|1, 0x8, 0x13);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, (0x3<<2)|2, 0x8, 0x10);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, (0x3<<2)|3, 0x8, 0x11);
|
||||
//Slot 3
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, (0x4<<2)|0, 0x8, 0x13);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, (0x4<<2)|1, 0x8, 0x10);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, (0x4<<2)|2, 0x8, 0x11);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x4, (0x4<<2)|3, 0x8, 0x12);
|
||||
//Slot 1
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x3, (0x3<<2)|0, 0x9, 0x0);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x3, (0x3<<2)|1, 0x9, 0x1);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x3, (0x3<<2)|2, 0x9, 0x2);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x3, (0x3<<2)|3, 0x9, 0x3);
|
||||
//Slot 2
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x3, (0x6<<2)|0, 0x9, 0x4);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x3, (0x6<<2)|1, 0x9, 0x5);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x3, (0x6<<2)|2, 0x9, 0x6);
|
||||
smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, 0x3, (0x6<<2)|3, 0x9, 0x7);
|
||||
|
||||
/*Local Ints: Type Polarity Trigger Bus ID IRQ APIC ID PIN#*/
|
||||
smp_write_intsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x0, 0x0, MP_APIC_ALL, 0x0);
|
||||
smp_write_intsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, 0x0, 0x0, MP_APIC_ALL, 0x1);
|
||||
/*
|
||||
MP Config Extended Table Entries:
|
||||
|
||||
--
|
||||
System Address Space
|
||||
bus ID: 0 address type: I/O address
|
||||
address base: 0x9000
|
||||
address range: 0x6000
|
||||
--
|
||||
System Address Space
|
||||
bus ID: 0 address type: I/O address
|
||||
address base: 0x0
|
||||
address range: 0x100
|
||||
--
|
||||
System Address Space
|
||||
bus ID: 0 address type: memory address
|
||||
address base: 0xa0000
|
||||
address range: 0x20000
|
||||
--
|
||||
System Address Space
|
||||
bus ID: 0 address type: memory address
|
||||
address base: 0xfc700000
|
||||
address range: 0x2500000
|
||||
--
|
||||
System Address Space
|
||||
bus ID: 0 address type: prefetch address
|
||||
address base: 0xff600000
|
||||
address range: 0x500000
|
||||
--
|
||||
Bus Heirarchy
|
||||
bus ID: 5 bus info: 0x01 parent bus ID: 0--
|
||||
Compatibility Bus Address
|
||||
bus ID: 0 address modifier: add
|
||||
predefined range: 0x00000000--
|
||||
Compatibility Bus Address
|
||||
bus ID: 0 address modifier: add
|
||||
predefined range: 0x00000001 // There is no extension information...
|
||||
*/
|
||||
/* Compute the checksums */
|
||||
mc->mpe_checksum = smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
|
||||
mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
|
||||
printk_debug("Wrote the mp table end at: %p - %p\n",
|
||||
mc, smp_next_mpe_entry(mc));
|
||||
return smp_next_mpe_entry(mc);
|
||||
}
|
||||
|
||||
unsigned long write_smp_table(unsigned long addr, unsigned long *processor_map)
|
||||
{
|
||||
void *v;
|
||||
v = smp_write_floating_table(addr);
|
||||
return (unsigned long)smp_write_config_table(v, processor_map);
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
config chip.h
|
||||
object northbridge.o
|
||||
#driver misc_control.o
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
struct northbridge_intel_e7501_config
|
||||
{
|
||||
};
|
||||
|
||||
extern struct chip_control northbridge_intel_e7501_control;
|
|
@ -0,0 +1,164 @@
|
|||
/*
|
||||
* generic K8 debug code, used by mainboard specific auto.c
|
||||
*
|
||||
*/
|
||||
#if 1
|
||||
static void print_debug_pci_dev(unsigned dev)
|
||||
{
|
||||
print_debug("PCI: ");
|
||||
print_debug_hex8((dev >> 16) & 0xff);
|
||||
print_debug_char(':');
|
||||
print_debug_hex8((dev >> 11) & 0x1f);
|
||||
print_debug_char('.');
|
||||
print_debug_hex8((dev >> 8) & 7);
|
||||
}
|
||||
|
||||
static void print_pci_devices(void)
|
||||
{
|
||||
device_t dev;
|
||||
for(dev = PCI_DEV(0, 0, 0);
|
||||
dev <= PCI_DEV(0, 0x1f, 0x7);
|
||||
dev += PCI_DEV(0,0,1)) {
|
||||
uint32_t id;
|
||||
id = pci_read_config32(dev, PCI_VENDOR_ID);
|
||||
if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
|
||||
(((id >> 16) & 0xffff) == 0xffff) ||
|
||||
(((id >> 16) & 0xffff) == 0x0000)) {
|
||||
continue;
|
||||
}
|
||||
print_debug_pci_dev(dev);
|
||||
print_debug("\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_pci_device(unsigned dev)
|
||||
{
|
||||
int i;
|
||||
print_debug_pci_dev(dev);
|
||||
print_debug("\r\n");
|
||||
|
||||
for(i = 0; i <= 255; i++) {
|
||||
unsigned char val;
|
||||
if ((i & 0x0f) == 0) {
|
||||
print_debug_hex8(i);
|
||||
print_debug_char(':');
|
||||
}
|
||||
val = pci_read_config8(dev, i);
|
||||
print_debug_char(' ');
|
||||
print_debug_hex8(val);
|
||||
if ((i & 0x0f) == 0x0f) {
|
||||
print_debug("\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_pci_devices(void)
|
||||
{
|
||||
device_t dev;
|
||||
for(dev = PCI_DEV(0, 0, 0);
|
||||
dev <= PCI_DEV(0, 0x1f, 0x7);
|
||||
dev += PCI_DEV(0,0,1)) {
|
||||
uint32_t id;
|
||||
id = pci_read_config32(dev, PCI_VENDOR_ID);
|
||||
if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
|
||||
(((id >> 16) & 0xffff) == 0xffff) ||
|
||||
(((id >> 16) & 0xffff) == 0x0000)) {
|
||||
continue;
|
||||
}
|
||||
dump_pci_device(dev);
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_spd_registers(const struct mem_controller *ctrl)
|
||||
{
|
||||
int i;
|
||||
print_debug("\r\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
unsigned device;
|
||||
device = ctrl->channel0[i];
|
||||
if (device) {
|
||||
int j;
|
||||
print_debug("dimm: ");
|
||||
print_debug_hex8(i);
|
||||
print_debug(".0: ");
|
||||
print_debug_hex8(device);
|
||||
for(j = 0; j < 256; j++) {
|
||||
int status;
|
||||
unsigned char byte;
|
||||
if ((j & 0xf) == 0) {
|
||||
print_debug("\r\n");
|
||||
print_debug_hex8(j);
|
||||
print_debug(": ");
|
||||
}
|
||||
status = smbus_read_byte(device, j);
|
||||
if (status < 0) {
|
||||
print_debug("bad device\r\n");
|
||||
break;
|
||||
}
|
||||
byte = status & 0xff;
|
||||
print_debug_hex8(byte);
|
||||
print_debug_char(' ');
|
||||
}
|
||||
print_debug("\r\n");
|
||||
}
|
||||
#if 0
|
||||
device = ctrl->channel1[i];
|
||||
if (device) {
|
||||
int j;
|
||||
print_debug("dimm: ");
|
||||
print_debug_hex8(i);
|
||||
print_debug(".1: ");
|
||||
print_debug_hex8(device);
|
||||
for(j = 0; j < 256; j++) {
|
||||
int status;
|
||||
unsigned char byte;
|
||||
if ((j & 0xf) == 0) {
|
||||
print_debug("\r\n");
|
||||
print_debug_hex8(j);
|
||||
print_debug(": ");
|
||||
}
|
||||
status = smbus_read_byte(device, j);
|
||||
if (status < 0) {
|
||||
print_debug("bad device\r\n");
|
||||
break;
|
||||
}
|
||||
byte = status & 0xff;
|
||||
print_debug_hex8(byte);
|
||||
print_debug_char(' ');
|
||||
}
|
||||
print_debug("\r\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
static void dump_smbus_registers(void)
|
||||
{
|
||||
int i;
|
||||
print_debug("\r\n");
|
||||
for(i = 1; i < 0x80; i++) {
|
||||
unsigned device;
|
||||
device = i;
|
||||
int j;
|
||||
print_debug("smbus: ");
|
||||
print_debug_hex8(device);
|
||||
for(j = 0; j < 256; j++) {
|
||||
int status;
|
||||
unsigned char byte;
|
||||
if ((j & 0xf) == 0) {
|
||||
print_debug("\r\n");
|
||||
print_debug_hex8(j);
|
||||
print_debug(": ");
|
||||
}
|
||||
status = smbus_read_byte(device, j);
|
||||
if (status < 0) {
|
||||
print_debug("bad device\r\n");
|
||||
break;
|
||||
}
|
||||
byte = status & 0xff;
|
||||
print_debug_hex8(byte);
|
||||
print_debug_char(' ');
|
||||
}
|
||||
print_debug("\r\n");
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,151 @@
|
|||
#include <console/console.h>
|
||||
#include <arch/io.h>
|
||||
#include <stdint.h>
|
||||
#include <mem.h>
|
||||
#include <part/sizeram.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/chip.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <bitops.h>
|
||||
#include "chip.h"
|
||||
|
||||
struct mem_range *sizeram(void)
|
||||
{
|
||||
static struct mem_range mem[4];
|
||||
/* the units of tolm are 64 KB */
|
||||
/* the units of drb16 are 64 MB */
|
||||
uint16_t tolm, remapbase, remaplimit, drb16;
|
||||
uint16_t tolm_r, remapbase_r, remaplimit_r;
|
||||
uint8_t drb;
|
||||
int remap_high;
|
||||
device_t dev;
|
||||
|
||||
dev = dev_find_slot(0, 0); // d0f0
|
||||
if (!dev) {
|
||||
printk_err("Cannot find PCI: 0:0\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Calculate and report the top of low memory and
|
||||
* any remapping.
|
||||
*/
|
||||
/* Test if the remap memory high option is set */
|
||||
remap_high = 0;
|
||||
// if(get_option(&remap_high, "remap_memory_high")){
|
||||
// remap_high = 0;
|
||||
// }
|
||||
printk_debug("remap_high is %d\n", remap_high);
|
||||
/* get out the value of the highest DRB. This tells the end of
|
||||
* physical memory. The units are ticks of 64 MB i.e. 1 means
|
||||
* 64 MB.
|
||||
*/
|
||||
drb = pci_read_config8(dev, 0x67);
|
||||
drb16 = (uint16_t)drb;
|
||||
if(remap_high && (drb16 > 0x08)) {
|
||||
/* We only come here if we have at least 512MB of memory,
|
||||
* so it is safe to hard code tolm.
|
||||
* 0x2000 means 512MB
|
||||
*/
|
||||
|
||||
tolm = 0x2000;
|
||||
/* i.e 0x40 * 0x40 is 0x1000 which is 4 GB */
|
||||
if(drb16 > 0x0040) {
|
||||
/* There is more than 4GB of memory put
|
||||
* the remap window at the end of ram.
|
||||
*/
|
||||
remapbase = drb16;
|
||||
remaplimit = remapbase + 0x38;
|
||||
}
|
||||
else {
|
||||
remapbase = 0x0040;
|
||||
remaplimit = remapbase + (drb16-8);
|
||||
}
|
||||
}
|
||||
else {
|
||||
tolm = (uint16_t)((dev_root.resource[1].base >> 16)&0x0f800);
|
||||
if((tolm>>8) >= (drb16<<2)) {
|
||||
tolm = (drb16<<10);
|
||||
remapbase = 0x3ff;
|
||||
remaplimit = 0;
|
||||
}
|
||||
else {
|
||||
remapbase = drb16;
|
||||
remaplimit = remapbase + ((0x0040-(tolm>>10))-1);
|
||||
}
|
||||
}
|
||||
/* Write the ram configruation registers,
|
||||
* preserving the reserved bits.
|
||||
*/
|
||||
tolm_r = pci_read_config16(dev, 0xc4);
|
||||
tolm |= (tolm_r & 0x7ff);
|
||||
pci_write_config16(dev, 0xc4, tolm);
|
||||
remapbase_r = pci_read_config16(dev, 0xc6);
|
||||
remapbase |= (remapbase_r & 0xfc00);
|
||||
pci_write_config16(dev, 0xc6, remapbase);
|
||||
remaplimit_r = pci_read_config16(dev, 0xc8);
|
||||
remaplimit |= (remaplimit_r & 0xfc00);
|
||||
pci_write_config16(dev, 0xc8, remaplimit);
|
||||
|
||||
#if 0
|
||||
printk_debug("mem info tolm = %x, drb = %x, pci_memory_base = %x, remap = %x-%x\n",tolm,drb,pci_memory_base,remapbase,remaplimit);
|
||||
#endif
|
||||
|
||||
mem[0].basek = 0;
|
||||
mem[0].sizek = 640;
|
||||
mem[1].basek = 768;
|
||||
/* Convert size in 64K bytes to size in K bytes */
|
||||
mem[1].sizek = (tolm << 6) - mem[1].basek;
|
||||
mem[2].basek = 0;
|
||||
mem[2].sizek = 0;
|
||||
if ((drb << 16) > (tolm << 6)) {
|
||||
/* We don't need to consider the remap window
|
||||
* here because we put it immediately after the
|
||||
* rest of ram.
|
||||
* All we must do is calculate the amount
|
||||
* of unused memory and report it at 4GB.
|
||||
*/
|
||||
mem[2].basek = 4096*1024;
|
||||
mem[2].sizek = (drb << 16) - (tolm << 6);
|
||||
}
|
||||
mem[3].basek = 0;
|
||||
mem[3].sizek = 0;
|
||||
|
||||
return mem;
|
||||
}
|
||||
static void enumerate(struct chip *chip)
|
||||
{
|
||||
extern struct device_operations default_pci_ops_bus;
|
||||
chip_enumerate(chip);
|
||||
chip->dev->ops = &default_pci_ops_bus;
|
||||
}
|
||||
#if 0
|
||||
static void northbridge_init(struct chip *chip, enum chip_pass pass)
|
||||
{
|
||||
|
||||
struct northbridge_intel_e7501_config *conf =
|
||||
(struct northbridge_intel_e7501_config *)chip->chip_info;
|
||||
|
||||
switch (pass) {
|
||||
case CONF_PASS_PRE_PCI:
|
||||
break;
|
||||
|
||||
case CONF_PASS_POST_PCI:
|
||||
break;
|
||||
|
||||
case CONF_PASS_PRE_BOOT:
|
||||
break;
|
||||
|
||||
default:
|
||||
/* nothing yet */
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
struct chip_control northbridge_intel_e7501_control = {
|
||||
.enumerate = enumerate,
|
||||
// .enable = northbridge_init,
|
||||
.name = "intel E7501 Northbridge",
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,12 @@
|
|||
#ifndef RAMINIT_H
|
||||
#define RAMINIT_H
|
||||
|
||||
#define DIMM_SOCKETS 4
|
||||
struct mem_controller {
|
||||
device_t d0, d0f1;
|
||||
uint16_t channel0[DIMM_SOCKETS];
|
||||
uint16_t channel1[DIMM_SOCKETS];
|
||||
};
|
||||
|
||||
|
||||
#endif /* RAMINIT_H */
|
|
@ -0,0 +1,18 @@
|
|||
/* Convert to C by yhlu */
|
||||
#define MCH_DRC 0x7c
|
||||
#define DRC_DONE (1 << 29)
|
||||
/* If I have already booted once skip a bunch of initialization */
|
||||
/* To see if I have already booted I check to see if memory
|
||||
* has been enabled.
|
||||
*/
|
||||
static int bios_reset_detected(void) {
|
||||
uint32_t dword;
|
||||
|
||||
dword = pci_read_config32(PCI_DEV(0, 0, 0), MCH_DRC);
|
||||
|
||||
if( (dword & DRC_DONE) != 0 ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
config i82801er.h
|
||||
driver i82801er.o
|
||||
driver i82801er_usb.o
|
||||
driver i82801er_lpc.o
|
||||
driver i82801er_ide.o
|
||||
driver i82801er_sata.o
|
||||
driver i82801er_usb2.o
|
||||
driver i82801er_ac97.o
|
||||
#driver i82801er_nic.o
|
||||
#driver i82801er_pci.o
|
||||
object i82801er_reset.o
|
|
@ -0,0 +1,16 @@
|
|||
//kind of cmos_err for ich5
|
||||
#define RTC_FAILED (1 <<2)
|
||||
#define GEN_PMCON_3 0xa4
|
||||
static void check_cmos_failed(void)
|
||||
{
|
||||
|
||||
uint8_t byte;
|
||||
byte = pci_read_config8(PCI_DEV(0,0x1f,0),GEN_PMCON_3);
|
||||
if( byte & RTC_FAILED){
|
||||
//clear bit 1 and bit 2
|
||||
byte = cmos_read(RTC_BOOT_BYTE);
|
||||
byte &= 0x0c;
|
||||
byte |= MAX_REBOOT_CNT << 4;
|
||||
cmos_write(byte, RTC_BOOT_BYTE);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/chip.h>
|
||||
#include "i82801er.h"
|
||||
|
||||
void i82801er_enable(device_t dev)
|
||||
{
|
||||
device_t lpc_dev;
|
||||
unsigned int index;
|
||||
uint16_t reg_old, reg;
|
||||
|
||||
// all 82801er device ares in bus 0
|
||||
unsigned int devfn;
|
||||
devfn = PCI_DEVFN(0x1f, 0); // lpc
|
||||
lpc_dev = dev_find_slot(0, devfn); // 0
|
||||
if (!lpc_dev ) {
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
if ((lpc_dev->vendor != PCI_VENDOR_ID_INTEL) ||
|
||||
(lpc_dev->device != PCI_DEVICE_ID_INTEL_82801ER_1F0)) {
|
||||
uint32_t id;
|
||||
id = pci_read_config32(lpc_dev, PCI_VENDOR_ID);
|
||||
if (id != (PCI_VENDOR_ID_INTEL | (PCI_DEVICE_ID_INTEL_82801ER_1F0 << 16))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
index = (dev->path.u.pci.devfn & 7);
|
||||
if((dev->path.u.pci.devfn & ~0x7)==devfn) { // D=0x1f
|
||||
if(index==0){ //1f0
|
||||
index = 14;
|
||||
}
|
||||
} else { // D=0x1d
|
||||
index += 8;
|
||||
}
|
||||
|
||||
reg_old = pci_read_config16(lpc_dev, FUNC_DIS);
|
||||
reg = reg_old;
|
||||
reg &= ~(1<<index); // enable it
|
||||
if (!dev->enabled) {
|
||||
reg |= (1<<index); // disable it
|
||||
}
|
||||
if (reg != reg_old) {
|
||||
pci_write_config16(lpc_dev, FUNC_DIS, reg);
|
||||
}
|
||||
reg = pci_read_config16(lpc_dev, FUNC_DIS);
|
||||
|
||||
}
|
||||
|
||||
struct chip_control southbridge_intel_i82801er_control = {
|
||||
.name = "Intel 82801er Southbridge",
|
||||
.enable_dev = i82801er_enable,
|
||||
};
|
|
@ -0,0 +1,81 @@
|
|||
#ifndef I82801ER_H
|
||||
#define I82801ER_H
|
||||
|
||||
struct southbridge_intel_i82801er_config
|
||||
{
|
||||
};
|
||||
struct chip_control;
|
||||
extern struct chip_control southbridge_intel_i82801er_control;
|
||||
|
||||
extern void i82801er_enable(device_t dev);
|
||||
|
||||
/*
|
||||
000 = Non-combined. P0 is primary master. P1 is secondary master.
|
||||
001 = Non-combined. P0 is secondary master. P1 is primary master.
|
||||
100 = Combined. P0 is primary master. P1 is primary slave. IDE is secondary; Primary IDE channel
|
||||
disabled.
|
||||
101 = Combined. P0 is primary slave. P1 is primary master. IDE is secondary.
|
||||
110 = Combined. IDE is primary. P0 is secondary master. P1 is secondary slave; Secondary IDE
|
||||
channel disabled.
|
||||
111 = Combined. IDE is primary. P0 is secondary slave. P1 is secondary master.
|
||||
*/
|
||||
|
||||
#define ICH5_SATA_ADDRESS_MAP 0
|
||||
|
||||
|
||||
#define PCI_DMA_CFG 0x90
|
||||
#define SERIRQ_CNTL 0x64
|
||||
#define GEN_CNTL 0xd0
|
||||
#define GEN_STS 0xd4
|
||||
#define RTC_CONF 0xd8
|
||||
#define GEN_PMCON_3 0xa4
|
||||
|
||||
#define PCICMD 0x04
|
||||
#define PMBASE 0x40
|
||||
#define ACPI_CNTL 0x44
|
||||
#define BIOS_CNTL 0x4E
|
||||
#define GPIO_BASE 0x58
|
||||
#define GPIO_CNTL 0x5C
|
||||
#define PIRQA_ROUT 0x60
|
||||
#define PIRQE_ROUT 0x68
|
||||
#define COM_DEC 0xE0
|
||||
#define LPC_EN 0xE6
|
||||
#define FUNC_DIS 0xF2
|
||||
|
||||
/* 1e f0 244e */
|
||||
|
||||
#define CMD 0x04
|
||||
#define SBUS_NUM 0x19
|
||||
#define SUB_BUS_NUM 0x1A
|
||||
#define SMLT 0x1B
|
||||
#define IOBASE 0x1C
|
||||
#define IOLIM 0x1D
|
||||
#define MEMBASE 0x20
|
||||
#define MEMLIM 0x22
|
||||
#define CNF 0x50
|
||||
#define MTT 0x70
|
||||
#define PCI_MAST_STS 0x82
|
||||
|
||||
#define RTC_FAILED (1 <<2)
|
||||
|
||||
|
||||
#define SMBUS_IO_BASE 0x1000
|
||||
|
||||
#define SMBHSTSTAT 0x0
|
||||
#define SMBHSTCTL 0x2
|
||||
#define SMBHSTCMD 0x3
|
||||
#define SMBXMITADD 0x4
|
||||
#define SMBHSTDAT0 0x5
|
||||
#define SMBHSTDAT1 0x6
|
||||
#define SMBBLKDAT 0x7
|
||||
#define SMBTRNSADD 0x9
|
||||
#define SMBSLVDATA 0xa
|
||||
#define SMLINK_PIN_CTL 0xe
|
||||
#define SMBUS_PIN_CTL 0xf
|
||||
|
||||
/* Between 1-10 seconds, We should never timeout normally
|
||||
* Longer than this is just painful when a timeout condition occurs.
|
||||
*/
|
||||
#define SMBUS_TIMEOUT (100*1000)
|
||||
|
||||
#endif /* I82801ER_H */
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* (C) 2003 Linux Networx
|
||||
*/
|
||||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include "i82801er.h"
|
||||
|
||||
|
||||
static struct device_operations ac97audio_ops = {
|
||||
.read_resources = pci_dev_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.enable = i82801er_enable,
|
||||
.init = 0,
|
||||
.scan_bus = 0,
|
||||
};
|
||||
|
||||
static struct pci_driver ac97audio_driver __pci_driver = {
|
||||
.ops = &ac97audio_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1F5,
|
||||
};
|
||||
|
||||
|
||||
static struct device_operations ac97modem_ops = {
|
||||
.read_resources = pci_dev_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.enable = i82801er_enable,
|
||||
.init = 0,
|
||||
.scan_bus = 0,
|
||||
};
|
||||
|
||||
static struct pci_driver ac97modem_driver __pci_driver = {
|
||||
.ops = &ac97modem_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1F6,
|
||||
};
|
|
@ -0,0 +1,156 @@
|
|||
|
||||
//#define SMBUS_IO_BASE 0x1000
|
||||
#define SMBUS_IO_BASE 0x0f00
|
||||
|
||||
#define SMBHSTSTAT 0x0
|
||||
#define SMBHSTCTL 0x2
|
||||
#define SMBHSTCMD 0x3
|
||||
#define SMBXMITADD 0x4
|
||||
#define SMBHSTDAT0 0x5
|
||||
#define SMBHSTDAT1 0x6
|
||||
#define SMBBLKDAT 0x7
|
||||
#define SMBTRNSADD 0x9
|
||||
#define SMBSLVDATA 0xa
|
||||
#define SMLINK_PIN_CTL 0xe
|
||||
#define SMBUS_PIN_CTL 0xf
|
||||
|
||||
/* Between 1-10 seconds, We should never timeout normally
|
||||
* Longer than this is just painful when a timeout condition occurs.
|
||||
*/
|
||||
#define SMBUS_TIMEOUT (100*1000*10)
|
||||
|
||||
static void enable_smbus(void)
|
||||
{
|
||||
device_t dev;
|
||||
dev = pci_locate_device(PCI_ID(0x8086, 0x24d3), 0);
|
||||
if (dev == PCI_DEV_INVALID) {
|
||||
die("SMBUS controller not found\r\n");
|
||||
}
|
||||
|
||||
print_debug("SMBus controller enabled\r\n");
|
||||
/* set smbus iobase */
|
||||
pci_write_config32(dev, 0x20, SMBUS_IO_BASE | 1);
|
||||
/* Set smbus enable */
|
||||
pci_write_config8(dev, 0x40, 0x01);
|
||||
/* Set smbus iospace enable */
|
||||
pci_write_config16(dev, 0x4, 0x01);
|
||||
/* Disable interrupt generation */
|
||||
outb(0, SMBUS_IO_BASE + SMBHSTCTL);
|
||||
/* clear any lingering errors, so the transaction will run */
|
||||
outb(inb(SMBUS_IO_BASE + SMBHSTSTAT), SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
}
|
||||
|
||||
|
||||
static inline void smbus_delay(void)
|
||||
{
|
||||
outb(0x80, 0x80);
|
||||
}
|
||||
|
||||
static int smbus_wait_until_ready(void)
|
||||
{
|
||||
unsigned long loops;
|
||||
loops = SMBUS_TIMEOUT;
|
||||
do {
|
||||
unsigned char val;
|
||||
smbus_delay();
|
||||
val = inb(SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
if ((val & 1) == 0) {
|
||||
break;
|
||||
}
|
||||
if(loops == (SMBUS_TIMEOUT / 2)) {
|
||||
outb(inb(SMBUS_IO_BASE + SMBHSTSTAT),
|
||||
SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
}
|
||||
} while(--loops);
|
||||
return loops?0:-2;
|
||||
}
|
||||
|
||||
static int smbus_wait_until_done(void)
|
||||
{
|
||||
unsigned long loops;
|
||||
loops = SMBUS_TIMEOUT;
|
||||
do {
|
||||
unsigned char val;
|
||||
smbus_delay();
|
||||
|
||||
val = inb(SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
if ( (val & 1) == 0) {
|
||||
break;
|
||||
}
|
||||
if ((val & ~((1<<6)|(1<<0)) ) != 0 ) {
|
||||
break;
|
||||
}
|
||||
} while(--loops);
|
||||
return loops?0:-3;
|
||||
}
|
||||
|
||||
static int smbus_read_byte(unsigned device, unsigned address)
|
||||
{
|
||||
unsigned char global_control_register;
|
||||
unsigned char global_status_register;
|
||||
unsigned char byte;
|
||||
|
||||
if (smbus_wait_until_ready() < 0) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* setup transaction */
|
||||
/* disable interrupts */
|
||||
outb(inb(SMBUS_IO_BASE + SMBHSTCTL) & 0xfe, SMBUS_IO_BASE + SMBHSTCTL);
|
||||
/* set the device I'm talking too */
|
||||
outb(((device & 0x7f) << 1) | 1, SMBUS_IO_BASE + SMBXMITADD);
|
||||
/* set the command/address... */
|
||||
outb(address & 0xFF, SMBUS_IO_BASE + SMBHSTCMD);
|
||||
/* set up for a byte data read */
|
||||
outb((inb(SMBUS_IO_BASE + SMBHSTCTL) & 0xe3) | (0x2<<2), SMBUS_IO_BASE + SMBHSTCTL);
|
||||
|
||||
/* clear any lingering errors, so the transaction will run */
|
||||
outb(inb(SMBUS_IO_BASE + SMBHSTSTAT), SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
|
||||
/* clear the data byte...*/
|
||||
outb(0, SMBUS_IO_BASE + SMBHSTDAT0);
|
||||
|
||||
/* start a byte read, with interrupts disabled */
|
||||
outb((inb(SMBUS_IO_BASE + SMBHSTCTL) | 0x40), SMBUS_IO_BASE + SMBHSTCTL);
|
||||
|
||||
|
||||
/* poll for transaction completion */
|
||||
if (smbus_wait_until_done() < 0) {
|
||||
return -3;
|
||||
}
|
||||
|
||||
global_status_register = inb(SMBUS_IO_BASE + SMBHSTSTAT) & ~(1<<6); /* Ignore the In Use Status... */
|
||||
|
||||
/* read results of transaction */
|
||||
byte = inb(SMBUS_IO_BASE + SMBHSTDAT0);
|
||||
|
||||
if (global_status_register != 2) {
|
||||
return -1;
|
||||
}
|
||||
return byte;
|
||||
}
|
||||
#if 0
|
||||
static void smbus_write_byte(unsigned device, unsigned address, unsigned char val)
|
||||
{
|
||||
if (smbus_wait_until_ready() < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* by LYH */
|
||||
outb(0x37,SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
/* set the device I'm talking too */
|
||||
outw(((device & 0x7f) << 1) | 0, SMBUS_IO_BASE + SMBHSTADDR);
|
||||
|
||||
/* data to send */
|
||||
outb(val, SMBUS_IO_BASE + SMBHSTDAT);
|
||||
|
||||
outb(address & 0xFF, SMBUS_IO_BASE + SMBHSTCMD);
|
||||
|
||||
/* start the command */
|
||||
outb(0xa, SMBUS_IO_BASE + SMBHSTCTL);
|
||||
|
||||
/* poll for transaction completion */
|
||||
smbus_wait_until_done();
|
||||
return;
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,53 @@
|
|||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include "i82801er.h"
|
||||
|
||||
|
||||
static void ide_init(struct device *dev)
|
||||
{
|
||||
#if ICH5_SATA_ADDRESS_MAP<=1
|
||||
/* Enable ide devices so the linux ide driver will work */
|
||||
uint16_t word;
|
||||
uint8_t byte;
|
||||
int enable_a=1, enable_b=1;
|
||||
|
||||
|
||||
word = pci_read_config16(dev, 0x40);
|
||||
word &= ~((1 << 15));
|
||||
if (enable_a) {
|
||||
/* Enable first ide interface */
|
||||
word |= (1<<15);
|
||||
printk_debug("IDE0 ");
|
||||
}
|
||||
pci_write_config16(dev, 0x40, word);
|
||||
|
||||
word = pci_read_config16(dev, 0x42);
|
||||
word &= ~((1 << 15));
|
||||
if (enable_a) {
|
||||
/* Enable secondary ide interface */
|
||||
word |= (1<<15);
|
||||
printk_debug("IDE1 ");
|
||||
}
|
||||
pci_write_config16(dev, 0x42, word);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static struct device_operations ide_ops = {
|
||||
.read_resources = pci_dev_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.init = ide_init,
|
||||
.scan_bus = 0,
|
||||
.enable = i82801er_enable,
|
||||
};
|
||||
|
||||
static struct pci_driver ide_driver __pci_driver = {
|
||||
.ops = &ide_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1F1,
|
||||
};
|
||||
|
|
@ -0,0 +1,219 @@
|
|||
/*
|
||||
* (C) 2003 Linux Networx, SuSE Linux AG
|
||||
* (C) 2004 Tyan Computer
|
||||
*/
|
||||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include <device/chip.h>
|
||||
#include <pc80/mc146818rtc.h>
|
||||
#include "i82801er.h"
|
||||
|
||||
void isa_dma_init(void); /* from /pc80/isa-dma.c */
|
||||
|
||||
#define NMI_OFF 0
|
||||
|
||||
void i82801er_enable_ioapic( struct device *dev)
|
||||
{
|
||||
uint32_t dword;
|
||||
volatile uint32_t *ioapic_sba = (volatile uint32_t *)0xfec00000;
|
||||
volatile uint32_t *ioapic_sbd = (volatile uint32_t *)0xfec00010;
|
||||
|
||||
dword = pci_read_config32(dev, GEN_CNTL);
|
||||
dword |= (3 << 7); /* enable ioapic */
|
||||
dword |= (1 <<13); /* coprocessor error enable */
|
||||
dword |= (1 << 1); /* delay transaction enable */
|
||||
dword |= (1 << 2); /* DMA collection buf enable */
|
||||
pci_write_config32(dev, GEN_CNTL, dword);
|
||||
printk_debug("ioapic southbridge enabled %x\n",dword);
|
||||
*ioapic_sba=0;
|
||||
*ioapic_sbd=(2<<24);
|
||||
//lyh *ioapic_sba=3;
|
||||
//lyh *ioapic_sbd=1;
|
||||
*ioapic_sba=0;
|
||||
dword=*ioapic_sbd;
|
||||
printk_debug("Southbridge apic id = %x\n",dword);
|
||||
if(dword!=(2<<24))
|
||||
for(;;);
|
||||
//lyh *ioapic_sba=3;
|
||||
//lyh dword=*ioapic_sbd;
|
||||
//lyh printk_debug("Southbridge apic DT = %x\n",dword);
|
||||
//lyh if(dword!=1)
|
||||
//lyh for(;;);
|
||||
|
||||
|
||||
}
|
||||
void i82801er_enable_serial_irqs( struct device *dev)
|
||||
{
|
||||
pci_write_config8(dev, SERIRQ_CNTL, (1 << 7)|(1 << 6)|((21 - 17) << 2)|(0<< 0));
|
||||
}
|
||||
void i82801er_lpc_route_dma( struct device *dev, uint8_t mask)
|
||||
{
|
||||
uint16_t word;
|
||||
int i;
|
||||
word = pci_read_config8(dev, PCI_DMA_CFG);
|
||||
word &= ((1 << 10) - (1 << 8));
|
||||
for(i = 0; i < 8; i++) {
|
||||
if (i == 4)
|
||||
continue;
|
||||
word |= ((mask & (1 << i))? 3:1) << (i*2);
|
||||
}
|
||||
pci_write_config16(dev, PCI_DMA_CFG, word);
|
||||
}
|
||||
void i82801er_rtc_init(struct device *dev)
|
||||
{
|
||||
uint8_t byte;
|
||||
uint32_t dword;
|
||||
int rtc_failed;
|
||||
byte = pci_read_config8(dev, GEN_PMCON_3);
|
||||
rtc_failed = byte & RTC_FAILED;
|
||||
if (rtc_failed) {
|
||||
byte &= ~(1 << 1); /* preserve the power fail state */
|
||||
pci_write_config8(dev, GEN_PMCON_3, byte);
|
||||
}
|
||||
dword = pci_read_config32(dev, GEN_STS);
|
||||
rtc_failed |= dword & (1 << 2);
|
||||
rtc_init(rtc_failed);
|
||||
}
|
||||
|
||||
|
||||
void i82801er_1f0_misc(struct device *dev)
|
||||
{
|
||||
pci_write_config16(dev, PCICMD, 0x014f);
|
||||
pci_write_config32(dev, PMBASE, 0x00001001);
|
||||
pci_write_config8(dev, ACPI_CNTL, 0x10);
|
||||
pci_write_config32(dev, GPIO_BASE, 0x00001181);
|
||||
pci_write_config8(dev, GPIO_CNTL, 0x10);
|
||||
pci_write_config32(dev, PIRQA_ROUT, 0x0A05030B);
|
||||
pci_write_config8(dev, PIRQE_ROUT, 0x07);
|
||||
pci_write_config8(dev, RTC_CONF, 0x04);
|
||||
pci_write_config8(dev, COM_DEC, 0x10); //lyh E0->
|
||||
pci_write_config16(dev, LPC_EN, 0x000F); //LYH 000D->
|
||||
}
|
||||
|
||||
static void enable_hpet(struct device *dev)
|
||||
{
|
||||
const unsigned long hpet_address = 0xfed0000;
|
||||
|
||||
uint32_t dword;
|
||||
uint32_t code = (0 & 0x3);
|
||||
|
||||
dword = pci_read_config32(dev, GEN_CNTL);
|
||||
dword |= (1 << 17); /* enable hpet */
|
||||
/*Bits [16:15]Memory Address Range
|
||||
00 FED0_0000h - FED0_03FFh
|
||||
01 FED0_1000h - FED0_13FFh
|
||||
10 FED0_2000h - FED0_23FFh
|
||||
11 FED0_3000h - FED0_33FFh*/
|
||||
|
||||
dword &= ~(3 << 15); /* clear it */
|
||||
dword |= (code<<15);
|
||||
|
||||
printk_debug("enabling HPET @0x%x\n", hpet_address | (code <<12) );
|
||||
}
|
||||
|
||||
static void lpc_init(struct device *dev)
|
||||
{
|
||||
uint8_t byte;
|
||||
int pwr_on=-1;
|
||||
int nmi_option;
|
||||
|
||||
/* IO APIC initialization */
|
||||
i82801er_enable_ioapic(dev);
|
||||
|
||||
i82801er_enable_serial_irqs(dev);
|
||||
|
||||
/* posted memory write enable */
|
||||
byte = pci_read_config8(dev, 0x46);
|
||||
pci_write_config8(dev, 0x46, byte | (1<<0));
|
||||
|
||||
/* power after power fail */
|
||||
/* FIXME this doesn't work! */
|
||||
/* Which state do we want to goto after g3 (power restored)?
|
||||
* 0 == S0 Full On
|
||||
* 1 == S5 Soft Off
|
||||
*/
|
||||
pci_write_config8(dev, GEN_PMCON_3, pwr_on?0:1);
|
||||
printk_info("set power %s after power fail\n", pwr_on?"on":"off");
|
||||
#if 0
|
||||
/* Enable Error reporting */
|
||||
/* Set up sync flood detected */
|
||||
byte = pci_read_config8(dev, 0x47);
|
||||
byte |= (1 << 1);
|
||||
pci_write_config8(dev, 0x47, byte);
|
||||
#endif
|
||||
|
||||
/* Set up NMI on errors */
|
||||
byte = pci_read_config8(dev, 0x61);
|
||||
byte |= (1 << 3); /* IOCHK# NMI Enable */
|
||||
byte |= (1 << 6); /* PCI SERR# Enable */
|
||||
pci_write_config8(dev, 0x61, byte);
|
||||
byte = pci_read_config8(dev, 0x70);
|
||||
nmi_option = NMI_OFF;
|
||||
get_option(&nmi_option, "nmi");
|
||||
if (nmi_option) {
|
||||
byte |= (1 << 7); /* set NMI */
|
||||
pci_write_config8(dev, 0x70, byte);
|
||||
}
|
||||
|
||||
/* Initialize the real time clock */
|
||||
i82801er_rtc_init(dev);
|
||||
|
||||
i82801er_lpc_route_dma(dev, 0xff);
|
||||
|
||||
/* Initialize isa dma */
|
||||
isa_dma_init();
|
||||
|
||||
i82801er_1f0_misc(dev);
|
||||
/* Initialize the High Precision Event Timers */
|
||||
enable_hpet(dev);
|
||||
}
|
||||
|
||||
static void i82801er_lpc_read_resources(device_t dev)
|
||||
{
|
||||
unsigned int reg;
|
||||
|
||||
/* Get the normal pci resources of this device */
|
||||
pci_dev_read_resources(dev);
|
||||
|
||||
/* Find my place in the resource list */
|
||||
reg = dev->resources;
|
||||
|
||||
/* Add an extra subtractive resource for both memory and I/O */
|
||||
dev->resource[reg].base = 0;
|
||||
dev->resource[reg].size = 0;
|
||||
dev->resource[reg].align = 0;
|
||||
dev->resource[reg].gran = 0;
|
||||
dev->resource[reg].limit = 0;
|
||||
dev->resource[reg].flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE | IORESOURCE_ASSIGNED;
|
||||
dev->resource[reg].index = 0;
|
||||
reg++;
|
||||
|
||||
dev->resource[reg].base = 0;
|
||||
dev->resource[reg].size = 0;
|
||||
dev->resource[reg].align = 0;
|
||||
dev->resource[reg].gran = 0;
|
||||
dev->resource[reg].limit = 0;
|
||||
dev->resource[reg].flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE | IORESOURCE_ASSIGNED;
|
||||
dev->resource[reg].index = 0;
|
||||
reg++;
|
||||
|
||||
dev->resources = reg;
|
||||
}
|
||||
|
||||
static struct device_operations lpc_ops = {
|
||||
.read_resources = i82801er_lpc_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.init = lpc_init,
|
||||
.scan_bus = scan_static_bus,
|
||||
.enable = i82801er_enable,
|
||||
};
|
||||
|
||||
static struct pci_driver lpc_driver __pci_driver = {
|
||||
.ops = &lpc_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1F0,
|
||||
};
|
|
@ -0,0 +1,21 @@
|
|||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include "i82801er.h"
|
||||
|
||||
|
||||
static struct device_operations nic_ops = {
|
||||
.read_resources = pci_dev_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.init = 0,
|
||||
.scan_bus = 0,
|
||||
};
|
||||
|
||||
static struct pci_driver nic_driver __pci_driver = {
|
||||
.ops = &nic_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = 0x1051,
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include "i82801er.h"
|
||||
|
||||
static void pci_init(struct device *dev)
|
||||
{
|
||||
/* Enable pci error detecting */
|
||||
uint32_t dword;
|
||||
/* System error enable */
|
||||
dword = pci_read_config32(dev, 0x04);
|
||||
dword |= (1<<8); /* SERR# Enable */
|
||||
dword |= (1<<6); /* Parity Error Response */
|
||||
pci_write_config32(dev, 0x04, dword);
|
||||
|
||||
}
|
||||
|
||||
static struct device_operations pci_ops = {
|
||||
.read_resources = pci_bus_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_bus_enable_resources,
|
||||
.init = pci_init,
|
||||
.scan_bus = pci_scan_bridge,
|
||||
};
|
||||
|
||||
static struct pci_driver pci_driver __pci_driver = {
|
||||
.ops = &pci_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1E0,
|
||||
};
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#include <arch/io.h>
|
||||
|
||||
void hard_reset(void)
|
||||
{
|
||||
/* Try rebooting through port 0xcf9 */
|
||||
outb((0 <<3)|(1<<2)|(1<<1), 0xcf9);
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include "i82801er.h"
|
||||
|
||||
static void sata_init(struct device *dev)
|
||||
{
|
||||
|
||||
uint16_t word;
|
||||
uint8_t byte;
|
||||
int enable_c=1, enable_d=1;
|
||||
int i;
|
||||
|
||||
//Enable Serial ATA port
|
||||
byte = pci_read_config8(dev,0x90);
|
||||
byte &= 0xf8;
|
||||
byte |= ICH5_SATA_ADDRESS_MAP & 7;
|
||||
pci_write_config8(dev,0x90,byte);
|
||||
|
||||
// for(i=0;i<10;i++) {
|
||||
word = pci_read_config16(dev,0x92);
|
||||
word &= 0xfffc;
|
||||
// if( (word & 0x0003) == 0x0003) break;
|
||||
word |= 0x0003; // enable P0/P1
|
||||
pci_write_config16(dev,0x92,word);
|
||||
// }
|
||||
|
||||
// for(i=0;i<10;i++) {
|
||||
/* enable ide0 */
|
||||
word = pci_read_config16(dev, 0x40);
|
||||
word &= ~(1 << 15);
|
||||
if(enable_c==0) {
|
||||
// if( (word & 0x8000) == 0x0000) break;
|
||||
word |= 0x0000;
|
||||
}
|
||||
else {
|
||||
// if( (word & 0x8000) == 0x8000) break;
|
||||
word |= 0x8000;
|
||||
}
|
||||
pci_write_config16(dev, 0x40, word);
|
||||
// }
|
||||
/* enable ide1 */
|
||||
// for(i=0;i<10;i++) {
|
||||
word = pci_read_config16(dev, 0x42);
|
||||
word &= ~(1 << 15);
|
||||
if(enable_d==0) {
|
||||
// if( (word & 0x8000) == 0x0000) break;
|
||||
word |= 0x0000;
|
||||
}
|
||||
else {
|
||||
// if( (word & 0x8000) == 0x8000) break;
|
||||
word |= 0x8000;
|
||||
}
|
||||
pci_write_config16(dev, 0x42, word);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
static struct device_operations sata_ops = {
|
||||
.read_resources = pci_dev_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.init = sata_init,
|
||||
.scan_bus = 0,
|
||||
.enable = i82801er_enable,
|
||||
};
|
||||
|
||||
static struct pci_driver stat_driver __pci_driver = {
|
||||
.ops = &sata_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1F2_R,
|
||||
};
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
#include <smbus.h>
|
||||
#include <pci.h>
|
||||
#include <arch/io.h>
|
||||
|
||||
#define PM_BUS 0
|
||||
#define PM_DEVFN PCI_DEVFN(0x1f,3)
|
||||
|
||||
#define SMBUS_IO_BASE 0x1000
|
||||
#define SMBHSTSTAT 0
|
||||
#define SMBHSTCTL 2
|
||||
#define SMBHSTCMD 3
|
||||
#define SMBHSTADD 4
|
||||
#define SMBHSTDAT0 5
|
||||
#define SMBHSTDAT1 6
|
||||
#define SMBBLKDAT 7
|
||||
|
||||
void smbus_enable(void)
|
||||
{
|
||||
unsigned char byte;
|
||||
/* iobase addr */
|
||||
pcibios_write_config_dword(PM_BUS, PM_DEVFN, 0x20, SMBUS_IO_BASE | 1);
|
||||
/* smbus enable */
|
||||
pcibios_write_config_byte(PM_BUS, PM_DEVFN, 0x40, 1);
|
||||
/* iospace enable */
|
||||
pcibios_write_config_word(PM_BUS, PM_DEVFN, 0x4, 1);
|
||||
|
||||
/* Disable interrupt generation */
|
||||
outb(0, SMBUS_IO_BASE + SMBHSTCTL);
|
||||
|
||||
}
|
||||
|
||||
void smbus_setup(void)
|
||||
{
|
||||
outb(0, SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
}
|
||||
|
||||
static void smbus_wait_until_ready(void)
|
||||
{
|
||||
while((inb(SMBUS_IO_BASE + SMBHSTSTAT) & 1) == 1) {
|
||||
/* nop */
|
||||
}
|
||||
}
|
||||
|
||||
static void smbus_wait_until_done(void)
|
||||
{
|
||||
unsigned char byte;
|
||||
do {
|
||||
byte = inb(SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
}
|
||||
while((byte &1) == 1);
|
||||
while( (byte & ~1) == 0) {
|
||||
byte = inb(SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
}
|
||||
}
|
||||
|
||||
int smbus_read_byte(unsigned device, unsigned address, unsigned char *result)
|
||||
{
|
||||
unsigned char host_status_register;
|
||||
unsigned char byte;
|
||||
|
||||
smbus_wait_until_ready();
|
||||
|
||||
/* setup transaction */
|
||||
/* disable interrupts */
|
||||
outb(inb(SMBUS_IO_BASE + SMBHSTCTL) & (~1), SMBUS_IO_BASE + SMBHSTCTL);
|
||||
/* set the device I'm talking too */
|
||||
outb(((device & 0x7f) << 1) | 1, SMBUS_IO_BASE + SMBHSTADD);
|
||||
/* set the command/address... */
|
||||
outb(address & 0xFF, SMBUS_IO_BASE + SMBHSTCMD);
|
||||
/* set up for a byte data read */
|
||||
outb((inb(SMBUS_IO_BASE + SMBHSTCTL) & 0xE3) | (0x2 << 2), SMBUS_IO_BASE + SMBHSTCTL);
|
||||
|
||||
/* clear any lingering errors, so the transaction will run */
|
||||
outb(inb(SMBUS_IO_BASE + SMBHSTSTAT), SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
|
||||
/* clear the data byte...*/
|
||||
outb(0, SMBUS_IO_BASE + SMBHSTDAT0);
|
||||
|
||||
/* start the command */
|
||||
outb((inb(SMBUS_IO_BASE + SMBHSTCTL) | 0x40), SMBUS_IO_BASE + SMBHSTCTL);
|
||||
|
||||
/* poll for transaction completion */
|
||||
smbus_wait_until_done();
|
||||
|
||||
host_status_register = inb(SMBUS_IO_BASE + SMBHSTSTAT);
|
||||
|
||||
/* read results of transaction */
|
||||
byte = inb(SMBUS_IO_BASE + SMBHSTDAT0);
|
||||
|
||||
*result = byte;
|
||||
return host_status_register != 0x02;
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include "i82801er.h"
|
||||
|
||||
static void usb_init(struct device *dev)
|
||||
{
|
||||
uint32_t cmd;
|
||||
|
||||
#if 0
|
||||
printk_debug("USB: Setting up controller.. ");
|
||||
cmd = pci_read_config32(dev, PCI_COMMAND);
|
||||
pci_write_config32(dev, PCI_COMMAND,
|
||||
cmd | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE);
|
||||
|
||||
|
||||
printk_debug("done.\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static struct device_operations usb_ops = {
|
||||
.read_resources = pci_dev_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.init = usb_init,
|
||||
.scan_bus = 0,
|
||||
.enable = i82801er_enable,
|
||||
};
|
||||
|
||||
static struct pci_driver usb_driver_1 __pci_driver = {
|
||||
.ops = &usb_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1D0,
|
||||
};
|
||||
static struct pci_driver usb_driver_2 __pci_driver = {
|
||||
.ops = &usb_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1D1,
|
||||
};
|
||||
static struct pci_driver usb_driver_3 __pci_driver = {
|
||||
.ops = &usb_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1D2,
|
||||
};
|
||||
static struct pci_driver usb_driver_4 __pci_driver = {
|
||||
.ops = &usb_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1D3,
|
||||
};
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
//2003 Copywright Tyan
|
||||
|
||||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include "i82801er.h"
|
||||
|
||||
static void usb2_init(struct device *dev)
|
||||
{
|
||||
uint32_t cmd;
|
||||
|
||||
#if 0
|
||||
printk_debug("USB: Setting up controller.. ");
|
||||
cmd = pci_read_config32(dev, PCI_COMMAND);
|
||||
pci_write_config32(dev, PCI_COMMAND,
|
||||
cmd | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
|
||||
PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE);
|
||||
|
||||
|
||||
printk_debug("done.\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
static struct device_operations usb2_ops = {
|
||||
.read_resources = pci_dev_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.init = usb2_init,
|
||||
.scan_bus = 0,
|
||||
.enable = i82801er_enable,
|
||||
};
|
||||
|
||||
static struct pci_driver usb2_driver __pci_driver = {
|
||||
.ops = &usb2_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82801ER_1D7,
|
||||
};
|
|
@ -0,0 +1,10 @@
|
|||
/* for io apic 1461 */
|
||||
#define PCICMD 0x04
|
||||
#define SUBSYS 0x2c
|
||||
#define MBAR 0x10
|
||||
#define ABAR 0x40
|
||||
|
||||
/* for pci bridge 1460 */
|
||||
#define MTT 0x042
|
||||
#define HCCR 0x0f0
|
||||
#define ACNF 0x0e0
|
|
@ -0,0 +1,3 @@
|
|||
driver p64h2_ioapic.o
|
||||
driver p64h2_pcibridge.o
|
||||
#driver p64h2_pci_parity.o
|
|
@ -0,0 +1,89 @@
|
|||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include <pc80/mc146818rtc.h>
|
||||
#include "82870.h"
|
||||
|
||||
static int ioapic_no = 0;
|
||||
|
||||
static void p64h2_ioapic_enable(device_t dev)
|
||||
{
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
|
||||
/* We have to enable MEM and Bus Master for IOAPIC */
|
||||
word = 0x0146;
|
||||
pci_write_config16(dev, PCICMD, word);
|
||||
dword = 0x358015d9;
|
||||
pci_write_config32(dev, SUBSYS, dword);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void p64h2_ioapic_init(device_t dev)
|
||||
{
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
int i, addr;
|
||||
|
||||
volatile uint32_t *ioapic_a; /* io apic io memory space command address */
|
||||
volatile uint32_t *ioapic_d; /* io apic io memory space data address */
|
||||
|
||||
i = ioapic_no++;
|
||||
|
||||
if(i<3) /* io apic address numbers are 3,4,5,&8 */
|
||||
addr=i+3;
|
||||
else
|
||||
addr=i+5;
|
||||
/* Read the MBAR address for setting up the io apic in io memory space */
|
||||
dword = pci_read_config32(dev, PCI_BASE_ADDRESS_0);
|
||||
ioapic_a = (uint32_t *) dword;
|
||||
ioapic_d = ioapic_a +0x04;
|
||||
printk_debug("IOAPIC %d at %02x:%02x.%01x MBAR = %x DataAddr = %x\n",
|
||||
addr, dev->bus->secondary,
|
||||
PCI_SLOT(dev->path.u.pci.devfn), PCI_FUNC(dev->path.u.pci.devfn),
|
||||
ioapic_a, ioapic_d);
|
||||
|
||||
#if 0
|
||||
dword = (u32)ioapic_a;
|
||||
word = 0x8000 + ((dword >>8)&0x0fff);
|
||||
pci_write_config_word(dev, ABAR, word);
|
||||
#endif
|
||||
/* Set up the io apic for the p64h2 - 1461 */
|
||||
*ioapic_a=0;
|
||||
*ioapic_d=(addr<<24); /* Set the address number */
|
||||
*ioapic_a=3;
|
||||
*ioapic_d=1; /* Enable the io apic */
|
||||
|
||||
/* This code test the setup to see if we really found the io apic */
|
||||
*ioapic_a=0;
|
||||
dword=*ioapic_d;
|
||||
printk_debug("PCI %d apic id = %x\n",addr,dword);
|
||||
if(dword!=(addr<<24))
|
||||
for(;;);
|
||||
*ioapic_a=3;
|
||||
dword=*ioapic_d;
|
||||
printk_debug("PCI %d apic DT = %x\n",addr,dword);
|
||||
if(dword!=1)
|
||||
for(;;);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static struct device_operations ioapic_ops = {
|
||||
.read_resources = pci_dev_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
.init = p64h2_ioapic_init,
|
||||
.scan_bus = 0,
|
||||
.enable = p64h2_ioapic_enable,
|
||||
};
|
||||
|
||||
static struct pci_driver ioapic_driver __pci_driver = {
|
||||
.ops = &ioapic_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82870_1E0,
|
||||
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
#include <mem.h>
|
||||
#include <pci.h>
|
||||
#include <arch/io.h>
|
||||
#include <printk.h>
|
||||
#
|
||||
|
||||
void p64h2_pci_parity_enable(void)
|
||||
{
|
||||
uint8_t reg;
|
||||
|
||||
/* 2SERREN - SERR enable for PCI bridge secondary device */
|
||||
/* 2PEREN - Parity error for PCI bridge secondary device */
|
||||
pcibios_read_config_byte(1, ((29 << 3) + (0 << 0)), 0x3e, ®);
|
||||
reg |= ((1 << 1) + (1 << 0));
|
||||
pcibios_write_config_byte(1, ((29 << 3) + (0 << 0)), 0x3e, reg);
|
||||
|
||||
/* 2SERREN - SERR enable for PCI bridge secondary device */
|
||||
/* 2PEREN - Parity error for PCI bridge secondary device */
|
||||
pcibios_read_config_byte(1, ((31 << 3) + (0 << 0)), 0x3e, ®);
|
||||
reg |= ((1 << 1) + (1 << 0));
|
||||
pcibios_write_config_byte(1, ((31 << 3) + (0 << 0)), 0x3e, reg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <device/pci_ops.h>
|
||||
#include <pc80/mc146818rtc.h>
|
||||
#include "82870.h"
|
||||
|
||||
static void p64h2_pcix_init(device_t dev)
|
||||
{
|
||||
uint32_t dword;
|
||||
uint16_t word;
|
||||
uint8_t byte;
|
||||
|
||||
|
||||
/* The purpose of changes to HCCR, ACNF, and MTT is to speed up the
|
||||
PCI bus for cards having high speed transfers. */
|
||||
dword = 0xc2040002;
|
||||
pci_write_config32(dev, HCCR, dword);
|
||||
dword = 0x0000c3bf;
|
||||
pci_write_config32(dev, ACNF, dword);
|
||||
byte = 0x08;
|
||||
pci_write_config8(dev, MTT, byte);
|
||||
|
||||
}
|
||||
static struct device_operations pcix_ops = {
|
||||
.read_resources = pci_bus_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_bus_enable_resources,
|
||||
.init = p64h2_pcix_init,
|
||||
.scan_bus = pci_scan_bridge,
|
||||
};
|
||||
|
||||
static struct pci_driver pcix_driver __pci_driver = {
|
||||
.ops = &pcix_ops,
|
||||
.vendor = PCI_VENDOR_ID_INTEL,
|
||||
.device = PCI_DEVICE_ID_INTEL_82870_1F0,
|
||||
};
|
||||
|
|
@ -16,13 +16,100 @@
|
|||
#include "chip.h"
|
||||
#include "w83627hf.h"
|
||||
|
||||
static void init(device_t dev)
|
||||
|
||||
void pnp_enter_ext_func_mode(device_t dev) {
|
||||
outb(0x87, dev->path.u.pnp.port);
|
||||
outb(0x87, dev->path.u.pnp.port);
|
||||
}
|
||||
void pnp_exit_ext_func_mode(device_t dev) {
|
||||
outb(0xaa, dev->path.u.pnp.port);
|
||||
}
|
||||
|
||||
void pnp_write_hwm(unsigned long port_base, uint8_t reg, uint8_t value)
|
||||
{
|
||||
outb(reg, port_base+5);
|
||||
outb(value, port_base+6);
|
||||
}
|
||||
|
||||
uint8_t pnp_read_hwm(unsigned long port_base, uint8_t reg)
|
||||
{
|
||||
outb(reg, port_base + 5);
|
||||
return inb(port_base + 6);
|
||||
}
|
||||
|
||||
static void enable_hwm_smbus(device_t dev) {
|
||||
uint8_t reg, value;
|
||||
reg = 0x2b;
|
||||
value = pnp_read_config(dev, reg);
|
||||
value &= 0x3f;
|
||||
pnp_write_config(dev, reg, value);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void dump_pnp_device(device_t dev)
|
||||
{
|
||||
int i;
|
||||
print_debug("\r\n");
|
||||
|
||||
for(i = 0; i <= 255; i++) {
|
||||
uint8_t reg, val;
|
||||
if ((i & 0x0f) == 0) {
|
||||
print_debug_hex8(i);
|
||||
print_debug_char(':');
|
||||
}
|
||||
reg = i;
|
||||
if(i!=0xaa) {
|
||||
val = pnp_read_config(dev, reg);
|
||||
}
|
||||
else {
|
||||
val = 0xaa;
|
||||
}
|
||||
print_debug_char(' ');
|
||||
print_debug_hex8(val);
|
||||
if ((i & 0x0f) == 0x0f) {
|
||||
print_debug("\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void init_hwm(unsigned long base)
|
||||
{
|
||||
uint8_t reg, value;
|
||||
int i;
|
||||
|
||||
unsigned hwm_reg_values[] = {
|
||||
// reg mask data
|
||||
0x40 , 0xff , 0x81, // ; Start Hardware Monitoring for WIN627
|
||||
0x48 , 0xaa , 0x2a, // ; Program SIO SMBus BAR to 54h>>1
|
||||
// 0x48 , 0xc8 , 0x48, // ; Program SIO SMBus BAR to 90h>>1
|
||||
0x4A , 0x21 , 0x21, // ; Program T2 SMBus BAR to 92h>>1 &
|
||||
// ; Program T3 SMBus BAR to 94h>>1
|
||||
0x4E , 0x80 , 0x00,
|
||||
0x43 , 0x00 , 0xFF,
|
||||
0x44 , 0x00 , 0x3F,
|
||||
0x4C , 0xBF , 0x18,
|
||||
0x4D , 0xFF , 0x80 // ; Turn Off Beep
|
||||
|
||||
};
|
||||
|
||||
for(i = 0; i< sizeof(hwm_reg_values)/sizeof(hwm_reg_values[0]); i+=3 ) {
|
||||
reg = hwm_reg_values[i];
|
||||
value = pnp_read_hwm(base, reg);
|
||||
value &= 0xff & hwm_reg_values[i+1];
|
||||
value |= 0xff & hwm_reg_values[i+2];
|
||||
#if 0
|
||||
printk_debug("base = 0x%04x, reg = 0x%02x, value = 0x%02x\r\n", base,reg,value);
|
||||
#endif
|
||||
pnp_write_hwm(base,reg, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void w83627hf_init(device_t dev)
|
||||
{
|
||||
struct superio_winbond_w83627hf_config *conf;
|
||||
struct resource *res0, *res1;
|
||||
/* Wishlist handle well known programming interfaces more
|
||||
* generically.
|
||||
*/
|
||||
if (!dev->enabled) {
|
||||
return;
|
||||
}
|
||||
|
@ -41,15 +128,70 @@ static void init(device_t dev)
|
|||
res1 = get_resource(dev, PNP_IDX_IO1);
|
||||
init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
|
||||
break;
|
||||
case W83627HF_HWM:
|
||||
res0 = get_resource(dev, PNP_IDX_IO0);
|
||||
init_hwm(res0->base);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void w83627hf_pnp_set_resources(device_t dev)
|
||||
{
|
||||
|
||||
pnp_enter_ext_func_mode(dev);
|
||||
|
||||
pnp_set_resources(dev);
|
||||
|
||||
#if 0
|
||||
dump_pnp_device(dev);
|
||||
#endif
|
||||
|
||||
pnp_exit_ext_func_mode(dev);
|
||||
|
||||
}
|
||||
|
||||
void w83627hf_pnp_enable_resources(device_t dev)
|
||||
{
|
||||
pnp_enter_ext_func_mode(dev);
|
||||
|
||||
pnp_enable_resources(dev);
|
||||
|
||||
switch(dev->path.u.pnp.device) {
|
||||
case W83627HF_HWM:
|
||||
//set the pin 91,92 as I2C bus
|
||||
printk_debug("w83627hf hwm smbus enabled\r\n");
|
||||
enable_hwm_smbus(dev);
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
dump_pnp_device(dev);
|
||||
#endif
|
||||
|
||||
pnp_exit_ext_func_mode(dev);
|
||||
|
||||
}
|
||||
|
||||
void w83627hf_pnp_enable(device_t dev)
|
||||
{
|
||||
|
||||
if (!dev->enabled) {
|
||||
pnp_enter_ext_func_mode(dev);
|
||||
|
||||
pnp_set_logical_device(dev);
|
||||
pnp_set_enable(dev, 0);
|
||||
|
||||
pnp_exit_ext_func_mode(dev);
|
||||
}
|
||||
}
|
||||
|
||||
static struct device_operations ops = {
|
||||
.read_resources = pnp_read_resources,
|
||||
.set_resources = pnp_set_resources,
|
||||
.enable_resources = pnp_enable_resources,
|
||||
.enable = pnp_enable,
|
||||
.init = init,
|
||||
.set_resources = w83627hf_pnp_set_resources,
|
||||
.enable_resources = w83627hf_pnp_enable_resources,
|
||||
.enable = w83627hf_pnp_enable,
|
||||
.init = w83627hf_init,
|
||||
};
|
||||
|
||||
static struct pnp_info pnp_dev_info[] = {
|
||||
|
@ -61,8 +203,8 @@ static struct pnp_info pnp_dev_info[] = {
|
|||
{ &ops, W83627HF_KBC, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_IRQ1, { 0x7ff, 0 }, { 0x7ff, 0x4}, },
|
||||
{ &ops, W83627HF_CIR, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
|
||||
{ &ops, W83627HF_GAME_MIDI_GPIO1, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7ff, 0 }, {0x7fe, 4} },
|
||||
{ &ops, W83627HF_GPIO2, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7ff, 0 }, {0x7fe, 4} },
|
||||
{ &ops, W83627HF_GPIO3, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7ff, 0 }, {0x7fe, 4} },
|
||||
{ &ops, W83627HF_GPIO2,},
|
||||
{ &ops, W83627HF_GPIO3,},
|
||||
{ &ops, W83627HF_ACPI, PNP_IRQ0, },
|
||||
{ &ops, W83627HF_HWM, PNP_IO0 | PNP_IRQ0, { 0xff8, 0 } },
|
||||
};
|
||||
|
@ -77,3 +219,4 @@ struct chip_control superio_winbond_w83627hf_control = {
|
|||
.enumerate = enumerate,
|
||||
.name = "Winbond w83627hf"
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,265 @@
|
|||
# Sample config file for
|
||||
# the Tyan s2735
|
||||
# This will make a target directory of ./s2735
|
||||
|
||||
loadoptions
|
||||
|
||||
target s2735
|
||||
|
||||
uses ARCH
|
||||
uses CONFIG_COMPRESS
|
||||
uses CONFIG_IOAPIC
|
||||
uses CONFIG_ROM_STREAM
|
||||
uses CONFIG_ROM_STREAM_START
|
||||
uses CONFIG_SMP
|
||||
uses CONFIG_UDELAY_TSC
|
||||
uses CPU_FIXUP
|
||||
uses FALLBACK_SIZE
|
||||
uses HAVE_FALLBACK_BOOT
|
||||
uses HAVE_MP_TABLE
|
||||
uses HAVE_PIRQ_TABLE
|
||||
uses i586
|
||||
uses i686
|
||||
uses INTEL_PPRO_MTRR
|
||||
uses HEAP_SIZE
|
||||
uses IRQ_SLOT_COUNT
|
||||
uses MAINBOARD
|
||||
uses MAINBOARD_PART_NUMBER
|
||||
uses MAINBOARD_VENDOR
|
||||
#uses MEMORY_HOLE
|
||||
uses PAYLOAD_SIZE
|
||||
uses _RAMBASE
|
||||
uses _ROMBASE
|
||||
uses ROM_IMAGE_SIZE
|
||||
uses ROM_SECTION_OFFSET
|
||||
uses ROM_SECTION_SIZE
|
||||
uses ROM_SIZE
|
||||
uses STACK_SIZE
|
||||
uses USE_FALLBACK_IMAGE
|
||||
uses USE_OPTION_TABLE
|
||||
uses HAVE_OPTION_TABLE
|
||||
uses CONFIG_CHIP_CONFIGURE
|
||||
|
||||
uses CONFIG_CONSOLE_BTEXT
|
||||
uses CONFIG_CONSOLE_SERIAL8250
|
||||
uses TTYS0_BAUD
|
||||
#SMDC Support
|
||||
#uses CONFIG_CONSOLE_SERIAL8250_2
|
||||
#uses TTYS1_BAUD
|
||||
uses DEFAULT_CONSOLE_LOGLEVEL
|
||||
uses MAXIMUM_CONSOLE_LOGLEVEL
|
||||
uses DEBUG
|
||||
uses CONFIG_MAX_CPUS
|
||||
uses CONFIG_LOGICAL_CPUS
|
||||
uses CONFIG_MAX_PHYSICAL_CPUS
|
||||
uses LINUXBIOS_EXTRA_VERSION
|
||||
uses XIP_ROM_SIZE
|
||||
uses XIP_ROM_BASE
|
||||
|
||||
uses CONFIG_FS_STREAM
|
||||
uses CONFIG_IDE
|
||||
|
||||
uses HAVE_HARD_RESET
|
||||
|
||||
#uses CONFIG_VGABIOS
|
||||
#uses CONFIG_REALMODE_IDT
|
||||
#uses CONFIG_PCIBIOS
|
||||
#uses VGABIOS_START
|
||||
#uses SCSIFW_START
|
||||
|
||||
#
|
||||
#uses CONFIG_LSI_SCSI_FW_FIXUP
|
||||
|
||||
option HAVE_OPTION_TABLE=1
|
||||
option HAVE_MP_TABLE=1
|
||||
option CPU_FIXUP=1
|
||||
option CONFIG_UDELAY_TSC=0
|
||||
option i686=1
|
||||
option i586=1
|
||||
option INTEL_PPRO_MTRR=1
|
||||
#option ROM_SIZE=524288
|
||||
option ROM_SIZE=1048576
|
||||
|
||||
option HAVE_HARD_RESET=1
|
||||
|
||||
#option CONFIG_CONSOLE_BTEXT=1
|
||||
#option CONFIG_VGABIOS=1
|
||||
#option CONFIG_REALMODE_IDT=1
|
||||
#option CONFIG_PCIBIOS=1
|
||||
#option VGABIOS_START=0xfff8c000
|
||||
#option SCSIFW_START=0xfff80000
|
||||
|
||||
#option CONFIG_FS_STREAM=1
|
||||
#option CONFIG_IDE=1
|
||||
|
||||
option HAVE_FALLBACK_BOOT=1
|
||||
|
||||
# use the new chip configure code.
|
||||
|
||||
option CONFIG_CHIP_CONFIGURE=1
|
||||
#option CONFIG_LSI_SCSI_FW_FIXUP=1
|
||||
|
||||
|
||||
#
|
||||
###
|
||||
### Build code to export a programmable irq routing table
|
||||
###
|
||||
option HAVE_PIRQ_TABLE=1
|
||||
option IRQ_SLOT_COUNT=15
|
||||
#
|
||||
###
|
||||
### Build code for SMP support
|
||||
### Only worry about 2 micro processors
|
||||
###
|
||||
option CONFIG_SMP=1
|
||||
option CONFIG_MAX_CPUS=4
|
||||
option CONFIG_LOGICAL_CPUS=1
|
||||
option CONFIG_MAX_PHYSICAL_CPUS=2
|
||||
#
|
||||
###
|
||||
### Build code to setup a generic IOAPIC
|
||||
###
|
||||
option CONFIG_IOAPIC=1
|
||||
#
|
||||
###
|
||||
### MEMORY_HOLE instructs earlymtrr.inc to
|
||||
### enable caching from 0-640KB and to disable
|
||||
### caching from 640KB-1MB using fixed MTRRs
|
||||
###
|
||||
### Enabling this option breaks SMP because secondary
|
||||
### CPU identification depends on only variable MTRRs
|
||||
### being enabled.
|
||||
###
|
||||
#option MEMORY_HOLE=0
|
||||
#
|
||||
###
|
||||
### Clean up the motherboard id strings
|
||||
###
|
||||
option MAINBOARD_PART_NUMBER="S2735"
|
||||
option MAINBOARD_VENDOR="Tyan"
|
||||
###
|
||||
### Compute the location and size of where this firmware image
|
||||
### (linuxBIOS plus bootloader) will live in the boot rom chip.
|
||||
###
|
||||
#option FALLBACK_SIZE=524288
|
||||
#option FALLBACK_SIZE=98304
|
||||
option FALLBACK_SIZE=131072
|
||||
|
||||
## ROM_IMAGE_SIZE is the amount of space to allow linuxBIOS to occupy.
|
||||
option ROM_IMAGE_SIZE=65536
|
||||
|
||||
|
||||
###
|
||||
### Compute where this copy of linuxBIOS will start in the boot rom
|
||||
###
|
||||
#
|
||||
###
|
||||
|
||||
## We do use compressed image
|
||||
option CONFIG_COMPRESS=1
|
||||
|
||||
option CONFIG_CONSOLE_SERIAL8250=1
|
||||
option TTYS0_BAUD=115200
|
||||
|
||||
#SMDC support
|
||||
#option CONFIG_CONSOLE_SERIAL8250_2=1
|
||||
#option TTYS1_BAUD=19200
|
||||
|
||||
|
||||
##
|
||||
### Select the linuxBIOS loglevel
|
||||
##
|
||||
## EMERG 1 system is unusable
|
||||
## ALERT 2 action must be taken immediately
|
||||
## CRIT 3 critical conditions
|
||||
## ERR 4 error conditions
|
||||
## WARNING 5 warning conditions
|
||||
## NOTICE 6 normal but significant condition
|
||||
## INFO 7 informational
|
||||
## DEBUG 8 debug-level messages
|
||||
## SPEW 9 Way too many details
|
||||
|
||||
## Request this level of debugging output
|
||||
option DEFAULT_CONSOLE_LOGLEVEL=8
|
||||
## At a maximum only compile in this level of debugging
|
||||
option MAXIMUM_CONSOLE_LOGLEVEL=8
|
||||
|
||||
option DEBUG=1
|
||||
|
||||
#
|
||||
|
||||
## LinuxBIOS C code runs at this location in RAM
|
||||
option _RAMBASE=0x004000
|
||||
|
||||
##
|
||||
## Use a 32K stack
|
||||
##
|
||||
option STACK_SIZE=0x8000
|
||||
|
||||
##
|
||||
## Use a 56K heap
|
||||
##
|
||||
option HEAP_SIZE=0xe000
|
||||
|
||||
#
|
||||
###
|
||||
### Compute the start location and size size of
|
||||
### The linuxBIOS bootloader.
|
||||
###
|
||||
option CONFIG_ROM_STREAM = 1
|
||||
|
||||
#
|
||||
#
|
||||
romimage "normal"
|
||||
# 48K for SCSI FW
|
||||
# option ROM_SIZE = 475136
|
||||
# 48K for SCSI FW and 48K for ATI ROM
|
||||
# option ROM_SIZE = 425984
|
||||
# 64K for Etherboot
|
||||
# option ROM_SIZE = 458752
|
||||
option LINUXBIOS_EXTRA_VERSION="$(shell cat ../../VERSION)_Normal"
|
||||
option USE_FALLBACK_IMAGE=0
|
||||
option ROM_SECTION_SIZE = (ROM_SIZE - FALLBACK_SIZE)
|
||||
option ROM_SECTION_OFFSET= 0
|
||||
|
||||
option PAYLOAD_SIZE = (ROM_SECTION_SIZE - ROM_IMAGE_SIZE)
|
||||
option CONFIG_ROM_STREAM_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
|
||||
option _ROMBASE = (CONFIG_ROM_STREAM_START + PAYLOAD_SIZE)
|
||||
|
||||
# option XIP_ROM_SIZE = FALLBACK_SIZE
|
||||
option XIP_ROM_SIZE = 65536
|
||||
option XIP_ROM_BASE = (_ROMBASE + ROM_IMAGE_SIZE - XIP_ROM_SIZE)
|
||||
|
||||
mainboard tyan/s2735
|
||||
# payload ../../../payloads/e1000--ide_disk.zelf
|
||||
# payload ../../../payloads/filo.elf
|
||||
# payload ../../../payloads/filo_mem.elf
|
||||
# payload ../../../payloads/filo_mem_btext.elf
|
||||
# payload ../../../payloads/filo_btext.zelf
|
||||
payload ../../../payloads/e1000--filo_btext.zelf
|
||||
end
|
||||
|
||||
romimage "fallback"
|
||||
option LINUXBIOS_EXTRA_VERSION="$(shell cat ../../VERSION)_Fallback"
|
||||
option USE_FALLBACK_IMAGE=1
|
||||
option ROM_SECTION_SIZE = FALLBACK_SIZE
|
||||
option ROM_SECTION_OFFSET= (ROM_SIZE - FALLBACK_SIZE)
|
||||
|
||||
option PAYLOAD_SIZE = (ROM_SECTION_SIZE - ROM_IMAGE_SIZE)
|
||||
option CONFIG_ROM_STREAM_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
|
||||
option _ROMBASE = (CONFIG_ROM_STREAM_START + PAYLOAD_SIZE)
|
||||
|
||||
# option XIP_ROM_SIZE = FALLBACK_SIZE
|
||||
option XIP_ROM_SIZE = 65536
|
||||
option XIP_ROM_BASE = (_ROMBASE + ROM_IMAGE_SIZE - XIP_ROM_SIZE)
|
||||
|
||||
mainboard tyan/s2735
|
||||
# payload ../../../payloads/e1000--ide_disk.zelf
|
||||
# payload ../../../payloads/filo_mem.elf
|
||||
# payload ../../../payloads/filo_mem_btext.elf
|
||||
# payload ../../../payloads/e1000_btext.zelf
|
||||
payload ../../../payloads/e1000--filo_btext.zelf
|
||||
|
||||
end
|
||||
|
||||
buildrom ./linuxbios.rom ROM_SIZE "normal" "fallback"
|
|
@ -0,0 +1 @@
|
|||
2.0
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
TYANMB=s27i35
|
||||
cd "$TYANMB"
|
||||
make
|
||||
#cat ../fwx.rom ../atix.rom ./normal/linuxbios.rom ./fallback/linuxbios.rom > $TYANMB"_linuxbios.rom"
|
||||
#cat ../fwx.rom ./normal/linuxbios.rom ./fallback/linuxbios.rom > $TYANMB"_linuxbios.rom"
|
||||
cat ./normal/linuxbios.rom ./fallback/linuxbios.rom > $TYANMB"_linuxbios.rom"
|
||||
cp -f $TYANMB"_linuxbios.rom" /home/yhlu/
|
Loading…
Reference in New Issue