Change the support for AMDs ElanSC520 CPU from being a device driver to
be options CPU_ELAN (NB: Soekris.com users!) It is cleaner this way. We still recognize the cpu on the host-pci bridge.
This commit is contained in:
parent
e46eeb89b9
commit
bd8add3d61
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102934
@ -1326,47 +1326,3 @@ print_transmeta_info()
|
||||
printf(" LongRun mode: %d <%dMHz %dmV %d%%>\n", crusoe_longrun,
|
||||
crusoe_frequency, crusoe_voltage, crusoe_percentage);
|
||||
}
|
||||
|
||||
/*
|
||||
* The AMD Elan sc520 is a system-on-chip gadget which is used in embedded
|
||||
* kind of things, see www.soekris.com for instance, and it has a few quirks
|
||||
* we need to deal with.
|
||||
* Unfortunately we cannot identify the gadget by CPUID output because it
|
||||
* depends on strapping options and only the stepping field may be useful
|
||||
* and those are undocumented from AMDs side.
|
||||
*
|
||||
* So instead we recognize the on-chip host-PCI bridge and call back from
|
||||
* sys/i386/pci/pci_bus.c to here if we find it.
|
||||
*/
|
||||
|
||||
#include <sys/proc.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
|
||||
uint16_t *elan_mmcr;
|
||||
|
||||
void
|
||||
init_AMD_Elan_sc520(void)
|
||||
{
|
||||
u_int new;
|
||||
int i;
|
||||
|
||||
printf("Doing h0h0magic for AMD Elan sc520\n");
|
||||
elan_mmcr = pmap_mapdev(0xfffef000, 0x1000);
|
||||
printf("MMCR at %p\n", elan_mmcr);
|
||||
|
||||
/*-
|
||||
* The i8254 is driven with a nonstandard frequency which is
|
||||
* derived thusly:
|
||||
* f = 32768 * 45 * 25 / 31 = 1189161.29...
|
||||
* We use the sysctl to get the timecounter etc into whack.
|
||||
*/
|
||||
|
||||
new = 1189161;
|
||||
i = kernel_sysctlbyname(&thread0, "machdep.i8254_freq",
|
||||
NULL, 0,
|
||||
&new, sizeof new,
|
||||
NULL);
|
||||
printf("sysctl machdep.i8254_freq=%d returns %d\n", new, i);
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,8 @@
|
||||
#include <machine/pc/bios.h>
|
||||
#include <machine/md_var.h>
|
||||
|
||||
#include "opt_cpu.h"
|
||||
|
||||
#include "pcib_if.h"
|
||||
|
||||
static int
|
||||
@ -179,7 +181,12 @@ nexus_pcib_is_host_bridge(int bus, int slot, int func,
|
||||
/* AMD -- vendor 0x1022 */
|
||||
case 0x30001022:
|
||||
s = "AMD Elan SC520 host to PCI bridge";
|
||||
#ifdef CPU_ELAN
|
||||
init_AMD_Elan_sc520();
|
||||
#else
|
||||
printf("*** WARNING: kernel option CPU_ELAN missing");
|
||||
printf("-- timekeeping may be wrong\n");
|
||||
#endif
|
||||
break;
|
||||
case 0x70061022:
|
||||
s = "AMD-751 host to PCI bridge";
|
||||
|
@ -192,7 +192,7 @@ i386/i386/db_disasm.c optional ddb
|
||||
i386/i386/db_interface.c optional ddb
|
||||
i386/i386/db_trace.c optional ddb
|
||||
i386/i386/dump_machdep.c standard
|
||||
i386/i386/elan-mmcr.c optional elan-mmcr
|
||||
i386/i386/elan-mmcr.c optional cpu_elan
|
||||
i386/i386/elf_machdep.c standard
|
||||
i386/i386/exception.s standard
|
||||
i386/i386/i386-gdbstub.c optional ddb
|
||||
|
@ -47,6 +47,7 @@ CPU_BTB_EN opt_cpu.h
|
||||
CPU_CYRIX_NO_LOCK opt_cpu.h
|
||||
CPU_DIRECT_MAPPED_CACHE opt_cpu.h
|
||||
CPU_DISABLE_5X86_LSSER opt_cpu.h
|
||||
CPU_ELAN opt_cpu.h
|
||||
CPU_FASTER_5X86_FPU opt_cpu.h
|
||||
CPU_I486_ON_386 opt_cpu.h
|
||||
CPU_IORT opt_cpu.h
|
||||
|
@ -85,6 +85,8 @@ cpu I686_CPU # aka Pentium Pro(tm)
|
||||
# reorder). This option should not be used if you use memory mapped
|
||||
# I/O device(s).
|
||||
#
|
||||
# CPU_ELAN enables support for AMDs ElanSC520 CPU.
|
||||
#
|
||||
# CPU_ENABLE_SSE enables SSE/MMX2 instructions support.
|
||||
#
|
||||
# CPU_FASTER_5X86_FPU enables faster FPU exception handler.
|
||||
@ -151,6 +153,7 @@ options CPU_BLUELIGHTNING_3X
|
||||
options CPU_BTB_EN
|
||||
options CPU_DIRECT_MAPPED_CACHE
|
||||
options CPU_DISABLE_5X86_LSSER
|
||||
options CPU_ELAN
|
||||
options CPU_ENABLE_SSE
|
||||
options CPU_FASTER_5X86_FPU
|
||||
options CPU_I486_ON_386
|
||||
@ -183,10 +186,6 @@ options GPL_MATH_EMULATE #Support for x87 emulation via
|
||||
#
|
||||
options PERFMON
|
||||
|
||||
#
|
||||
# Stuff specific to the AMD Elan Sc520 cpu.
|
||||
device elan-mmcr # Support mapping MMCR in userland.
|
||||
|
||||
|
||||
#####################################################################
|
||||
# NETWORKING OPTIONS
|
||||
|
@ -8,14 +8,58 @@
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* The AMD Elan sc520 is a system-on-chip gadget which is used in embedded
|
||||
* kind of things, see www.soekris.com for instance, and it has a few quirks
|
||||
* we need to deal with.
|
||||
* Unfortunately we cannot identify the gadget by CPUID output because it
|
||||
* depends on strapping options and only the stepping field may be useful
|
||||
* and those are undocumented from AMDs side.
|
||||
*
|
||||
* So instead we recognize the on-chip host-PCI bridge and call back from
|
||||
* sys/i386/pci/pci_bus.c to here if we find it.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/timetc.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
#include <machine/md_var.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
|
||||
uint16_t *elan_mmcr;
|
||||
|
||||
void
|
||||
init_AMD_Elan_sc520(void)
|
||||
{
|
||||
u_int new;
|
||||
int i;
|
||||
|
||||
printf("Doing h0h0magic for AMD Elan sc520\n");
|
||||
elan_mmcr = pmap_mapdev(0xfffef000, 0x1000);
|
||||
printf("MMCR at %p\n", elan_mmcr);
|
||||
|
||||
/*-
|
||||
* The i8254 is driven with a nonstandard frequency which is
|
||||
* derived thusly:
|
||||
* f = 32768 * 45 * 25 / 31 = 1189161.29...
|
||||
* We use the sysctl to get the timecounter etc into whack.
|
||||
*/
|
||||
|
||||
new = 1189161;
|
||||
i = kernel_sysctlbyname(&thread0, "machdep.i8254_freq",
|
||||
NULL, 0,
|
||||
&new, sizeof new,
|
||||
NULL);
|
||||
printf("sysctl machdep.i8254_freq=%d returns %d\n", new, i);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Device driver initialization stuff
|
||||
*/
|
||||
@ -79,5 +123,4 @@ elan_drvinit(void)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SYSINIT(elan, SI_SUB_PSEUDO, SI_ORDER_MIDDLE+CDEV_MAJOR,elan_drvinit,NULL);
|
||||
|
@ -1326,47 +1326,3 @@ print_transmeta_info()
|
||||
printf(" LongRun mode: %d <%dMHz %dmV %d%%>\n", crusoe_longrun,
|
||||
crusoe_frequency, crusoe_voltage, crusoe_percentage);
|
||||
}
|
||||
|
||||
/*
|
||||
* The AMD Elan sc520 is a system-on-chip gadget which is used in embedded
|
||||
* kind of things, see www.soekris.com for instance, and it has a few quirks
|
||||
* we need to deal with.
|
||||
* Unfortunately we cannot identify the gadget by CPUID output because it
|
||||
* depends on strapping options and only the stepping field may be useful
|
||||
* and those are undocumented from AMDs side.
|
||||
*
|
||||
* So instead we recognize the on-chip host-PCI bridge and call back from
|
||||
* sys/i386/pci/pci_bus.c to here if we find it.
|
||||
*/
|
||||
|
||||
#include <sys/proc.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
|
||||
uint16_t *elan_mmcr;
|
||||
|
||||
void
|
||||
init_AMD_Elan_sc520(void)
|
||||
{
|
||||
u_int new;
|
||||
int i;
|
||||
|
||||
printf("Doing h0h0magic for AMD Elan sc520\n");
|
||||
elan_mmcr = pmap_mapdev(0xfffef000, 0x1000);
|
||||
printf("MMCR at %p\n", elan_mmcr);
|
||||
|
||||
/*-
|
||||
* The i8254 is driven with a nonstandard frequency which is
|
||||
* derived thusly:
|
||||
* f = 32768 * 45 * 25 / 31 = 1189161.29...
|
||||
* We use the sysctl to get the timecounter etc into whack.
|
||||
*/
|
||||
|
||||
new = 1189161;
|
||||
i = kernel_sysctlbyname(&thread0, "machdep.i8254_freq",
|
||||
NULL, 0,
|
||||
&new, sizeof new,
|
||||
NULL);
|
||||
printf("sysctl machdep.i8254_freq=%d returns %d\n", new, i);
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,8 @@
|
||||
#include <machine/pc/bios.h>
|
||||
#include <machine/md_var.h>
|
||||
|
||||
#include "opt_cpu.h"
|
||||
|
||||
#include "pcib_if.h"
|
||||
|
||||
static int
|
||||
@ -179,7 +181,12 @@ nexus_pcib_is_host_bridge(int bus, int slot, int func,
|
||||
/* AMD -- vendor 0x1022 */
|
||||
case 0x30001022:
|
||||
s = "AMD Elan SC520 host to PCI bridge";
|
||||
#ifdef CPU_ELAN
|
||||
init_AMD_Elan_sc520();
|
||||
#else
|
||||
printf("*** WARNING: kernel option CPU_ELAN missing");
|
||||
printf("-- timekeeping may be wrong\n");
|
||||
#endif
|
||||
break;
|
||||
case 0x70061022:
|
||||
s = "AMD-751 host to PCI bridge";
|
||||
|
Loading…
Reference in New Issue
Block a user