Fix accidental disable of Geode UARTs
This commit is contained in:
parent
44626c910e
commit
88906eaa69
3 changed files with 28 additions and 6 deletions
|
@ -254,7 +254,12 @@ serial_hw_init:
|
||||||
#ifdef FULOONG
|
#ifdef FULOONG
|
||||||
lui $a0, %hi(GRUB_CS5536_MSR_DIVIL_LEG_IO)
|
lui $a0, %hi(GRUB_CS5536_MSR_DIVIL_LEG_IO)
|
||||||
addiu $a0, $a0, %lo(GRUB_CS5536_MSR_DIVIL_LEG_IO)
|
addiu $a0, $a0, %lo(GRUB_CS5536_MSR_DIVIL_LEG_IO)
|
||||||
li $a1, 0x04570003
|
li $a1, (GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 \
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP \
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 \
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1 \
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 \
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1)
|
||||||
bal wrmsr
|
bal wrmsr
|
||||||
move $a2, $zero
|
move $a2, $zero
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <grub/pci.h>
|
#include <grub/pci.h>
|
||||||
#include <grub/time.h>
|
#include <grub/time.h>
|
||||||
#include <grub/ata.h>
|
#include <grub/ata.h>
|
||||||
|
#include <grub/machine/kernel.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_cs5536_find (grub_pci_device_t *devp)
|
grub_cs5536_find (grub_pci_device_t *devp)
|
||||||
|
@ -264,11 +265,25 @@ grub_cs5536_init_geode (grub_pci_device_t dev)
|
||||||
GRUB_CS5536_LBAR_TURN_ON | GRUB_CS5536_LBAR_PM);
|
GRUB_CS5536_LBAR_TURN_ON | GRUB_CS5536_LBAR_PM);
|
||||||
|
|
||||||
/* Setup DIVIL. */
|
/* Setup DIVIL. */
|
||||||
grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_LEG_IO,
|
switch (grub_arch_machine)
|
||||||
GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86
|
{
|
||||||
| GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP
|
case GRUB_ARCH_MACHINE_YEELOONG:
|
||||||
| GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0
|
grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_LEG_IO,
|
||||||
| GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1);
|
GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1);
|
||||||
|
break;
|
||||||
|
case GRUB_ARCH_MACHINE_FULOONG:
|
||||||
|
grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_LEG_IO,
|
||||||
|
GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0
|
||||||
|
| GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_PRIMARY_MASK,
|
grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_PRIMARY_MASK,
|
||||||
(~GRUB_CS5536_DIVIL_LPC_INTERRUPTS) & 0xffff);
|
(~GRUB_CS5536_DIVIL_LPC_INTERRUPTS) & 0xffff);
|
||||||
grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_LPC_MASK,
|
grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_LPC_MASK,
|
||||||
|
|
|
@ -75,6 +75,8 @@
|
||||||
#define GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1 0x00000002
|
#define GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1 0x00000002
|
||||||
#define GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 0x10000000
|
#define GRUB_CS5536_MSR_DIVIL_LEG_IO_MODE_X86 0x10000000
|
||||||
#define GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP 0x04000000
|
#define GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP 0x04000000
|
||||||
|
#define GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1 0x00070000
|
||||||
|
#define GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 0x00500000
|
||||||
#define GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_PRIMARY_MASK 0x80000024
|
#define GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_PRIMARY_MASK 0x80000024
|
||||||
#define GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_LPC_MASK 0x80000025
|
#define GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_LPC_MASK 0x80000025
|
||||||
#define GRUB_CS5536_DIVIL_LPC_INTERRUPTS 0x1002
|
#define GRUB_CS5536_DIVIL_LPC_INTERRUPTS 0x1002
|
||||||
|
|
Loading…
Reference in a new issue