Fuloong support.

* configure.ac: Rename yeeloong platform to loongson. All users updated.
	* grub-core/Makefile.core.def (fwstart_fuloong): New image.
	* grub-core/boot/mips/loongson/fuloong.S: New file.
	* grub-core/boot/mips/loongson/fwstart.S: Wait for CS5536 to come up.
	Explicitly init CS5536.
	[FULOONG]: Don't use serial until CS5536 is available.
	Set GPIO based on dumps.
	(serial_hw_init) [FULOONG]: Handle CS5536 parts.
	[FULOONG]: Handle GPIO and memory controller differences.
	Parse machine type in $a2.
	* grub-core/boot/mips/startup_raw.S: Determine and save the
	architecture.
	* grub-core/bus/cs5536.c (gpiodump): Move to fwstart.S.
	(grub_cs5536_init_geode): Remove gpio part. Conditionalise DIVIL
	init on architecture type.
	* grub-core/kern/mips/loongson/init.c (grub_machine_init): Init
	SIS315E. Don't init at_keyboard on fuloong.
	(grub_halt): Support Fuloong.
	* grub-core/kern/mips/startup.S [LOONGSON]: Save $s7.
	* grub-core/loader/mips/linux.c (LOONGSON_MACHTYPE): Removed.
	(loongson_machtypes): New array.
	(grub_cmd_linux) [GRUB_MACHINE_MIPS_LOONGSON]: Pass the right machine
	type.
	* grub-core/term/ns8250.c (serial_get_divisor): New parameter port and
	config. All users updated. Handle CS5536 serial.
	* grub-core/term/serial.c (grub_serial_register): Conditionalise
	default port on machine type. Register serial as inactive.
	* grub-core/video/sis315pro.c: New file.
	* include/grub/cs5536.h (GRUB_CS5536_MSR_MAILBOX_CONFIG_ENABLED): New
	definition.
	(GRUB_CS5536_MSR_MAILBOX_CONFIG): Likewise.
	(GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1): Likewise.
	(GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3): Likewise.
	(GRUB_CS5536_MSR_DIVIL_UART1_CONF): Likewise.
	(GRUB_CS5536_MSR_DIVIL_UART2_CONF): Likewise.
	* include/grub/mips/loongson.h (GRUB_CPU_LOONGSON_SHUTDOWN_GPIO): Rename
	to ...
	(GRUB_CPU_YEELOONG_SHUTDOWN_GPIO): ... this.
	* include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_YEELOONG): New
	definition.
	(GRUB_ARCH_MACHINE_FULOONG): Likewise.
	(grub_arch_machine): New extern var.
	* include/grub/mips/loongson/serial.h
	(GRUB_MACHINE_SERIAL_DIVISOR_115200): Renamed to ...
	(GRUB_MACHINE_SERIAL_PORT0_DIVISOR_115200): ... this.
	(GRUB_MACHINE_SERIAL_PORT): Renamed to ...
	(GRUB_MACHINE_SERIAL_PORT0): ... this.
	(GRUB_MACHINE_SERIAL_PORT2_DIVISOR_115200): New definition.
	(GRUB_MACHINE_SERIAL_PORT1): Likewise.
	(GRUB_MACHINE_SERIAL_PORT2): Likewise.
	(GRUB_MACHINE_SERIAL_PORTS): Include ports 1 and 2.
	* include/grub/term.h (grub_term_register_input_inactive): New inline
	function.
	(grub_term_register_output_inactive): Likewise.
	* include/grub/video.h (grub_video_driver_id): New value
	GRUB_VIDEO_DRIVER_SIS315PRO.
	* util/grub-mkimage.c (image_target_desc): Rename name to dirname.
	New field "names". All users updated.
	New field value IMAGE_FULOONG_FLASH.
	(generate_image): USe separate fwstart hashes for yeeloong and fuloong.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-05-15 01:43:44 +02:00
commit 5d063cdc10
37 changed files with 843 additions and 252 deletions

View file

@ -26,9 +26,11 @@
#endif
#define GRUB_CS5536_PCIID 0x208f1022
#define GRUB_CS5536_MSR_MAILBOX_ADDR 0xf4
#define GRUB_CS5536_MSR_MAILBOX_DATA0 0xf8
#define GRUB_CS5536_MSR_MAILBOX_DATA1 0xfc
#define GRUB_CS5536_MSR_MAILBOX_CONFIG_ENABLED 0x1
#define GRUB_CS5536_MSR_MAILBOX_CONFIG 0xf0
#define GRUB_CS5536_MSR_MAILBOX_ADDR 0xf4
#define GRUB_CS5536_MSR_MAILBOX_DATA0 0xf8
#define GRUB_CS5536_MSR_MAILBOX_DATA1 0xfc
#define GRUB_CS5536_MSR_IRQ_MAP_BAR 0x80000008
#define GRUB_CS5536_MSR_SMB_BAR 0x8000000b
@ -73,11 +75,15 @@
#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_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_LPC_MASK 0x80000025
#define GRUB_CS5536_DIVIL_LPC_INTERRUPTS 0x1002
#define GRUB_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL 0x8000004e
#define GRUB_CS5536_MSR_DIVIL_LPC_SERIAL_IRQ_CONTROL_ENABLE 0x80
#define GRUB_CS5536_MSR_DIVIL_UART1_CONF 0x8000003a
#define GRUB_CS5536_MSR_DIVIL_UART2_CONF 0x8000003e
#define GRUB_CS5536_MSR_USB_OHCI_BASE 0x40000008
#define GRUB_CS5536_MSR_USB_EHCI_BASE 0x40000009

View file

@ -85,6 +85,6 @@
#define GRUB_CPU_LOONGSON_PCI_HIT1_SEL_HI 0xbfe00154
#define GRUB_CPU_LOONGSON_GPIOCFG 0xbfe00120
#define GRUB_CPU_LOONGSON_SHUTDOWN_GPIO 1
#define GRUB_CPU_YEELOONG_SHUTDOWN_GPIO 1
#endif

View file

@ -21,11 +21,16 @@
#include <grub/symbol.h>
#define GRUB_ARCH_MACHINE_YEELOONG 0
#define GRUB_ARCH_MACHINE_FULOONG 1
#ifndef ASM_FILE
void EXPORT_FUNC (grub_reboot) (void) __attribute__ ((noreturn));
void EXPORT_FUNC (grub_halt) (void) __attribute__ ((noreturn));
extern grub_uint32_t EXPORT_VAR (grub_arch_machine);
#endif
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */

View file

@ -24,10 +24,10 @@
#include <grub/cpu/io.h>
#endif
#define GRUB_YEELOONG_OHCI_PCIID 0x00351033
#define GRUB_YEELOONG_EHCI_PCIID 0x00e01033
#define GRUB_YEELOONG_OHCI_GHOST_FUNCTION 4
#define GRUB_YEELOONG_EHCI_GHOST_FUNCTION 5
#define GRUB_LOONGSON_OHCI_PCIID 0x00351033
#define GRUB_LOONGSON_EHCI_PCIID 0x00e01033
#define GRUB_LOONGSON_OHCI_GHOST_FUNCTION 4
#define GRUB_LOONGSON_EHCI_GHOST_FUNCTION 5
#define GRUB_PCI_NUM_BUS 1
#define GRUB_PCI_NUM_DEVICES 16

View file

@ -19,11 +19,14 @@
#ifndef GRUB_MACHINE_SERIAL_HEADER
#define GRUB_MACHINE_SERIAL_HEADER 1
#define GRUB_MACHINE_SERIAL_DIVISOR_115200 2
#define GRUB_MACHINE_SERIAL_PORT 0xbff003f8
#define GRUB_MACHINE_SERIAL_PORT0_DIVISOR_115200 2
#define GRUB_MACHINE_SERIAL_PORT2_DIVISOR_115200 1
#define GRUB_MACHINE_SERIAL_PORT0 0xbff003f8
#define GRUB_MACHINE_SERIAL_PORT1 0xbfd003f8
#define GRUB_MACHINE_SERIAL_PORT2 0xbfd002f8
#ifndef ASM_FILE
#define GRUB_MACHINE_SERIAL_PORTS { GRUB_MACHINE_SERIAL_PORT }
#define GRUB_MACHINE_SERIAL_PORTS { GRUB_MACHINE_SERIAL_PORT0, GRUB_MACHINE_SERIAL_PORT1, GRUB_MACHINE_SERIAL_PORT2 }
#else
#endif

View file

@ -100,16 +100,16 @@
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR 0x200000
#define GRUB_KERNEL_MIPS_YEELOONG_LINK_ADDR 0x80200000
#define GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR 0x80200000
#define GRUB_KERNEL_MIPS_YEELOONG_LINK_ALIGN 32
#define GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN 32
#define GRUB_KERNEL_MIPS_YEELOONG_COMPRESSED_SIZE 0x8
#define GRUB_KERNEL_MIPS_YEELOONG_UNCOMPRESSED_SIZE 0xc
#define GRUB_KERNEL_MIPS_LOONGSON_COMPRESSED_SIZE 0x8
#define GRUB_KERNEL_MIPS_LOONGSON_UNCOMPRESSED_SIZE 0xc
#define GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE 0x08
#define GRUB_KERNEL_MIPS_YEELOONG_PREFIX 0x0c
#define GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END 0x54
#define GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE 0x08
#define GRUB_KERNEL_MIPS_LOONGSON_PREFIX 0x0c
#define GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END 0x54
/* The offset of GRUB_PREFIX. */
#define GRUB_KERNEL_I386_EFI_PREFIX 0x8
@ -144,7 +144,7 @@
#define GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN 0x1000
#define GRUB_KERNEL_MIPS_YEELOONG_MOD_ALIGN 0x1
#define GRUB_KERNEL_MIPS_LOONGSON_MOD_ALIGN 0x1
/* Minimal gap between _end and the start of the modules. It's a hack
for PowerMac to prevent "CLAIM failed" error. The real fix is to

View file

@ -102,7 +102,7 @@ grub_serial_config_defaults (struct grub_serial_port *port)
{
struct grub_serial_config config =
{
#ifdef GRUB_MACHINE_MIPS_YEELOONG
#ifdef GRUB_MACHINE_MIPS_LOONGSON
.speed = 115200,
#else
.speed = 9600,

View file

@ -248,6 +248,14 @@ grub_term_register_input (const char *name __attribute__ ((unused)),
}
}
static inline void
grub_term_register_input_inactive (const char *name __attribute__ ((unused)),
grub_term_input_t term)
{
grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs_disabled),
GRUB_AS_LIST (term));
}
static inline void
grub_term_register_input_active (const char *name __attribute__ ((unused)),
grub_term_input_t term)
@ -272,6 +280,14 @@ grub_term_register_output (const char *name __attribute__ ((unused)),
}
}
static inline void
grub_term_register_output_inactive (const char *name __attribute__ ((unused)),
grub_term_output_t term)
{
grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs_disabled),
GRUB_AS_LIST (term));
}
static inline void
grub_term_register_output_active (const char *name __attribute__ ((unused)),
grub_term_output_t term)

View file

@ -211,7 +211,8 @@ typedef enum grub_video_driver_id
GRUB_VIDEO_DRIVER_VGA,
GRUB_VIDEO_DRIVER_CIRRUS,
GRUB_VIDEO_DRIVER_BOCHS,
GRUB_VIDEO_DRIVER_SDL
GRUB_VIDEO_DRIVER_SDL,
GRUB_VIDEO_DRIVER_SIS315PRO,
} grub_video_driver_id_t;
typedef enum grub_video_adapter_prio