Commit graph

17 commits

Author SHA1 Message Date
Vladimir Serbinenko
054efe541f * grub-core/boot/mips/startup_raw.S: Handle the case of gap between
.data and .bss. May happen if compiler and assembly use different
	alignment.
2013-11-22 05:07:32 +01:00
Vladimir Serbinenko
6f4a19f59f Use $t9 for indirect calls from asm to C as PIC ABI requires. 2013-11-22 04:45:05 +01:00
Vladimir 'phcoder' Serbinenko
17f9fd29d3 Implement grub_machine_get_bootlocation for ARC. 2013-04-27 19:12:11 +02:00
Vladimir 'phcoder' Serbinenko
aa94b87027 Fix MIPS compilation.
* grub-core/boot/mips/startup_raw.S: Use GRUB_DECOMPRESSOR_*
	* include/grub/offsets.h: Rename decompressor fields from
	GRUB_KERNEL_* to GRUB_DECOMPRESSOR_*.
	* util/grub-mkimage.c (image_targets): Use new names.
2011-11-12 21:38:04 +01:00
Vladimir 'phcoder' Serbinenko
60240b8bc1 Use decompressors framework on i386-pc. It increases core size
by 46 bytes but improves compatibility and maintainability.

	* grub-core/Makefile.core.def (lzma_decompress): New image.
	(kernel): Add i386_pc_ldflags.
	* grub-core/kern/i386/pc/startup.S: Move intial part to ..
	* grub-core/boot/i386/pc/startup_raw.S: ... here. Pass pointers
	to real_to_prot, prot_to_real and device info.
	* include/grub/offsets.h: Renamed decompressor offsets.
	* util/grub-mkimage.c (grub_compression_t): New cmpression lzma.
	(image_target_desc): Remove raw_size and rename decompressor fields.
	(compress_kernel): Handle lzma.
	(generate_image): Handle decompressors on i386-pc.
2011-11-12 19:53:25 +01:00
Vladimir 'phcoder' Serbinenko
14a2562cf7 Rename Fuloong into Fuloong 2F. Add new ID for Fuloong2E.
* grub-core/Makefile.core.def (fwstart_fuloong): Rename fwstart_fuloong
	into fwstart_fuloong2f. Use boot/mips/loongson/fuloong2f.S.
	* grub-core/boot/mips/loongson/fuloong.S: Rename to ...
	* grub-core/boot/mips/loongson/fuloong2f.S: ... this.
	(FULOONG): Rename to ...
	(FULOONG2F): ... this. All users updated.
	* grub-core/boot/mips/startup_raw.S (machtype_fuloong_str): Rename to
	(machtype_fuloong2f_str): ... this.
	(machtype_fuloong2e_str): New string.
	Check for machtype_fuloong2e_str.
	* grub-core/loader/mips/linux.c (loongson_machtypes)
	[GRUB_MACHINE_MIPS_LOONGSON]: Add GRUB_ARCH_MACHINE_FULOONG2E.
	* grub-core/term/serial.c (loongson_defserial)
	[GRUB_MACHINE_MIPS_LOONGSON]: New array.
	(grub_serial_register) [GRUB_MACHINE_MIPS_LOONGSON]: Use
	loongson_defserial.
	* include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_FULOONG):
	Rename to ...
	(GRUB_ARCH_MACHINE_FULOONG2F): ... this.
	(GRUB_ARCH_MACHINE_FULOONG2E): New const.
	* util/grub-mkimage.c (image_target_desc): Rename IMAGE_FULOONG_FLASH
	to IMAGE_FULOONG2F_FLASH. All users updated.
	(image_targets): Rename images.
	* util/grub-mkstandalone.in: Accept fuloong2f and fuloong2e.
2011-08-19 22:46:11 +02:00
Vladimir 'phcoder' Serbinenko
748ccabea1 MIPS qemu flash support.
* grub-core/boot/mips/startup_raw.S [GRUB_MACHINE_MIPS_QEMU_MIPS]: Check
	magic.
	* grub-core/kern/mips/qemu_mips/init.c (probe_mem): New function.
	(grub_machine_init): Probe memory if its size isn't known.
	* util/grub-mkimage.c (image_targets): Add flash targets.
	(generate_image): Handle flash targets.
2011-07-05 21:42:36 +02:00
Vladimir 'phcoder' Serbinenko
b772baedcd Reduce memory footprint on SGI by putting modules before the kernel
as opposed to after.

	* grub-core/Makefile.core.def (kernel): Increase linking address.
	(none_decompress): Likewise.
	(xz_decompress): Likewise.
	* grub-core/boot/mips/startup_raw.S: Use prewritten uncompression
	address.
	* grub-core/kern/mips/arc/init.c (grub_machine_init): Handle memory
	layout change.
	(grub_arch_modules_addr): New function.
	* grub-core/kern/mips/init.c (grub_arch_modules_addr): Moved from here...
	* grub-core/kern/mips/loongson/init.c (grub_arch_modules_addr): .. here
	* grub-core/kern/mips/qemu_mips/init.c (grub_arch_modules_addr): ... and
	here.
	* grub-core/kern/mips/startup.S (total_size): Rename to ...
	(grub_total_modules_size): ... this. Make global.
	[GRUB_MACHINE_ARC]: Don't attempt to move modules out of the bss.
	* include/grub/offsets.h (GRUB_KERNEL_MIPS_LOONGSON_UNCOMPRESSED_ADDR):
	New definition.
	(GRUB_KERNEL_MIPS_QEMU_MIPS_UNCOMPRESSED_ADDR): Likewise.
	(GRUB_KERNEL_MIPS_ARC_UNCOMPRESSED_ADDR): Likewise.
	(GRUB_KERNEL_MACHINE_UNCOMPRESSED_ADDR): Likewise.
	(GRUB_KERNEL_MIPS_ARC_LINK_ADDR): Increased.
	* util/grub-mkimage.c (image_target_desc): New flag
	PLATFORM_FLAGS_MODULES_BEFORE_KERNEL.
	(image_targets): Set PLATFORM_FLAGS_MODULES_BEFORE_KERNEL on mips-arc.
	(generate_image): Handle images with modules before kernel.
2011-05-17 21:15:54 +02:00
Vladimir 'phcoder' Serbinenko
566a191715 Prevent potential loss of memory map by overwrite on qemu-mips.
* grub-core/boot/mips/startup_raw.S [GRUB_MACHINE_MIPS_QEMU_MIPS]:
	Save ram size in $s4.
	* grub-core/kern/mips/qemu_mips/init.c (RAMSIZE): Removed.
	All users changed to grub_arch_memsize.
	* grub-core/kern/mips/startup.S (grub_arch_machine): Restrict to
	Loongson.
	[GRUB_MACHINE_MIPS_QEMU_MIPS]: Save grub_arch_memsize.
	* grub-core/loader/mips/linux.c (grub_linux_boot): Pass memory size.
	* include/grub/mips/qemu_mips/memory.h (grub_arch_memsize): New
	external variable.
2011-05-17 19:32:51 +02:00
Vladimir 'phcoder' Serbinenko
5d063cdc10 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.
2011-05-15 01:43:44 +02:00
Vladimir 'phcoder' Serbinenko
60ddfad3da * grub-core/boot/mips/startup_raw.S: Flush cache after loading
decompressor.
2011-05-13 15:35:06 +02:00
Vladimir 'phcoder' Serbinenko
a298aa046c * grub-core/boot/mips/startup_raw.S: Use jalr rather than bal to call
grub_decompress_core since later would fail if grub_decompress_core
	is too far.
2011-05-13 15:20:16 +02:00
Vladimir 'phcoder' Serbinenko
54da1febce Rename mipsel-yeeloong to mipsel-loongson 2011-02-19 13:18:05 +01:00
Vladimir 'phcoder' Serbinenko
8f49d04c98 machtype autodetection 2011-01-18 19:04:27 +01:00
Vladimir 'phcoder' Serbinenko
9a0e5c815e Fix bugs in asm code 2010-09-22 00:53:34 +02:00
Vladimir 'phcoder' Serbinenko
e0a8ef26e4 MAke a separate scratch for decompressor 2010-09-21 19:39:51 +02:00
Vladimir 'phcoder' Serbinenko
c5b4cd370e asm part for mips decompressor 2010-09-21 10:14:08 +02:00