TOP
SSV Software Systems Register  Register
Log in to check your private messages  Log in to check your private messages
Startseite FAQ Search Mitglieder Profile  Log in 
SSV Support-Forum
BIOS-Parameter zur Laufzeit ändern

 
Post new topic   Reply to topic    SSV-Forum Forum Index >>> eSOM/2x86
<<< Previous topic - Next topic >>>  
Display posts from previous:   
Author Message
hne



Joined: 11 Jul 2008
Posts: 210
Location: Hannover

PostPosted: 02.12.2010, 14:46    Post subject: BIOS-Parameter zur Laufzeit ändern Reply with quote

Eine häufige Frage:
Wie kann man BIOS-Parameter permanent speichern oder zur Laufzeit ändern?


Die BIOS-Einstellungen lassen sich nicht permanent ändern. Wird die Batterie entfernt, fallen alle Einstellungen auf die Standard-Einstellungen zurück.
Das BIOS greift aber auch nur auf bestimmte Bits in den PCI-Registern zu, so daß man diese Bits auch zur Laufzeit ändern kann.

Am Beispiel für den CS1 bis CS3 sollen die IO-Wait-States von 4 clocks auf 1 clock verändert werden.

Die Wait States kann man über die erweiterten Register der PCI-ISA-Bridge setzen. Das gewünschte Register befindet sich in der South Bridge:

  • Register Offset: C3-C0h
  • Register Name: Internal Peripheral Feature Control Register
  • Bits 24 bis 26 sind für den 8-bit IO: 000 = 1 Clock, 001 = 2 Clocks, ... 111 = 8 Clocks
  • Zu finden im Manual zur CPU "Vortex86DX-DS.pdf" auf Seite 317

Ändern kann man das Register per Kernel-Modul mit Funktionen wie "pci_write_config_word".
Per User-Programm geht es auch, ist aber komplizierter und erfolgt in rohen Hex-Werten, siehe manpage für lspci und setpci.

Zur Kontrolle erst einmal die Register anzeigen lassen:
Code:
emblinux:~# lspci -d 17f3:6031 -xx -x
00:07.0 ISA bridge: Unknown device 17f3:6031
00: f3 17 31 60 0f 00 00 06 00 00 01 06 00 00 00 00
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 32
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 02 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: d2 15 00 84 f8 03 00 00 00 00 0f 15 00 00 00 00
60: 78 00 79 00 7a 00 7b 00 7c 00 98 00 9f 02 00 00
70: 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 0d 00 f0 ff ff 0d
90: 01 80 0c 00 c0 ff ff 0d 01 01 00 00 80 ff 00 0c
a0: f8 02 82 00 e8 03 84 00 e8 02 82 00 00 00 00 00
b0: 00 00 00 04 39 00 00 00 00 00 00 00 01 12 00 00
c0: 40 39 2c 03 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

In einer der Zeilen sieht man dann die Register C3-C0:
Code:
c0: 40 39 2c 03

Die "03" in der Zeile beinhaltet Bit 24 bis 31. Es sind also 4 clocks eingestellt. Wer unsicher ist, sollte jetzt noch einmal die Werte im BIOS ändern, und sich dann die geänderten Register anzeigen lassen.

In dem Fall hat man Glück. Weil alle oberen Bits 0 sind, kann man ganz einfach 1 Clock einstellen:
Code:
setpci -d 17f3:6031 -s 00:07.0 c3.b=00

Für 2 Clocks:
Code:
setpci -d 17f3:6031 -s 00:07.0 c3.b=01

usw. bis 8 Clocks:
Code:
setpci -d 17f3:6031 -s 00:07.0 c3.b=07

Bitte beachten, daß ein Schreiben in ein falsches PCI-Register oder einer unbedachten Bitkombination das System in einen undefinierten Zustand oder zum Absturz bringen kann. Das Programm niemals ohne den Parameter -d aufrufen!

Das Ändern der Wait-States für 8-bit IO an sich ist völlig harmlos, denn es sind auf dem CPU-Modul keine weiteren Geräte am 8bit-ISA-Bus angeschlossen.
_________________
Henry Nestler


Last edited by hne on 31.05.2012, 12:51; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
hne



Joined: 11 Jul 2008
Posts: 210
Location: Hannover

PostPosted: 02.12.2010, 15:00    Post subject: CS4 per Kernel-Modul auf IO umstellen Reply with quote

Auf ähnliche Art könnte man auch den CS4 komplett ändern, z.B. anstelle des Standard Memory-Mappings in einen IO-POrt.

Das CS4 am eSOM/2586 wird innerhalb der CPU als "Chip Select 0" bezeichnet.
Hier ein Auszug aus einem Kernel-Modul, um das CS4 auf einen 16-bit IO-Adress-Bereich von 0x200-0x207 zu programmieren:
Code:

/* Address definition for eSOM/2586 CS4 */
#define ISA_IOBASE          0x200   /* Start address on ISA I/O bus */
#define ISA_IOSIZE          8       /* Number of low I/O ports used */

#define DMP_ISA_BRIDGE_VID  0x17f3  /* RDC Semiconductor, Inc. */
#define DMP_ISA_BRIDGE_PID  0x6031  /* R6031 ISA Bridge */
#define DMP_GPCS0_BASE      0x90    /* Base Address Offset and enable */
#define DMP_GPCS0_CTRL      0x94    /* Base Address Mask and I/O-Controls */

/* Configure PCI-ISA bridge for I/O 16 bit */
static int dmp_isa_bridge_config (void)
{
    struct pci_dev *pci;

    // Access ISA bridge on southbridge
    pci = pci_get_subsys(DMP_ISA_BRIDGE_VID, DMP_ISA_BRIDGE_PID, PCI_ANY_ID, PCI_ANY_ID, NULL);
    if (!pci) {
        printk(KERN_ERR "ISA bridge %x:%x not found\n", DMP_ISA_BRIDGE_VID, DMP_ISA_BRIDGE_PID);
        return -ENODEV;
    }

    /* Chip Select 0 Base Address Offset and enable */
    pci_write_config_word(pci, DMP_GPCS0_BASE, ISA_IOBASE+1); /* low+enable */
    pci_write_config_word(pci, DMP_GPCS0_BASE+2, 0);         /* high */

    /* Chip Select 0 Base Address Mask and I/O-Controls */
    pci_write_config_word(pci, DMP_GPCS0_CTRL, 0xffff-(ISA_IOSIZE-1)); /*mask*/
    pci_write_config_word(pci, DMP_GPCS0_CTRL+2, 0x0e00); /* controls */

    pci_dev_put(pci);
    return 0;
}

int init_module(void)
{
    if (dmp_isa_bridge_config())
        return -ENODEV;
...

_________________
Henry Nestler
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SSV-Forum Forum Index >>> eSOM/2x86 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

SSV Software Systems GmbH

Dünenweg 5
30419 Hannover

Fon: +49(0)511  ·  40 000-0
Fax: +49(0)511  ·  40 000-40

sales@ssv-embedded.de


Impressum    ·    Datenschutz    ·    AGB

© 2023 SSV SOFTWARE SYSTEMS GmbH. Alle Rechte vorbehalten.

ISO 9001:2015