if COND_i386_ieee1275
CFLAGS_PLATFORM += -mrtd -mregparm=3
endif
-if COND_mips_yeeloong
+if COND_mips_loongson
CFLAGS_PLATFORM += -mexplicit-relocs
CPPFLAGS_PLATFORM = -DUSE_ASCII_FAILBACK
CCASFLAGS_PLATFORM = -march=mips3
powerpc-*) platform=ieee1275 ;;
powerpc64-*) platform=ieee1275 ;;
sparc64-*) platform=ieee1275 ;;
- mips-*) platform=yeeloong ;;
+ mips-*) platform=loongson ;;
*) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
esac
else
powerpc-ieee1275) ;;
sparc64-ieee1275) ;;
mips-qemu-mips) ;;
- mips-yeeloong) ;;
+ mips-yeeloong) platform=loongson ;;
+ mips-fuloong) platform=loongson ;;
+ mips-loongson) ;;
*-emu) ;;
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
esac
qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
- yeeloong) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
+ loongson) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_LOONGSON=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
qemu-mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
esac
case "$target_cpu" in
done
done
-if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xyeeloong ); then
- AC_MSG_ERROR([qemu and yeeloong ports need unifont])
+if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson ); then
+ AC_MSG_ERROR([qemu and loongson ports need unifont])
fi
AC_SUBST([FONT_SOURCE])
TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
fi
-if test "${target_cpu}-${platform}" = mips-yeeloong; then
+if test "${target_cpu}-${platform}" = mips-loongson; then
AC_CACHE_CHECK([whether -march=loongson2f works], [grub_cv_cc_march_loongson2f], [
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -march=loongson2f"
AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot])
AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
-AM_CONDITIONAL([COND_mips_yeeloong], [test x$target_cpu = xmips -a x$platform = xyeeloong])
+AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmips -a x$platform = xloongson])
AM_CONDITIONAL([COND_mips_qemu_mips], [test x$target_cpu = xmips -a x$platform = xqemu_mips])
AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot",
"i386_multiboot", "i386_ieee1275", "x86_64_efi",
- "mips_yeeloong", "sparc64_ieee1275",
+ "mips_loongson", "sparc64_ieee1275",
"powerpc_ieee1275" ]
GROUPS = {}
GROUPS["i386"] = [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275" ]
GROUPS["x86_64"] = [ "x86_64_efi" ]
GROUPS["x86"] = GROUPS["i386"] + GROUPS["x86_64"]
-GROUPS["mips"] = [ "mips_yeeloong" ]
+GROUPS["mips"] = [ "mips_loongson" ]
GROUPS["sparc64"] = [ "sparc64_ieee1275" ]
GROUPS["powerpc"] = [ "powerpc_ieee1275" ]
GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu")
# Groups based on hardware features
-GROUPS["cmos"] = GROUPS["x86"][:] + ["mips_yeeloong"]; GROUPS["cmos"].remove("i386_efi"); GROUPS["cmos"].remove("x86_64_efi")
+GROUPS["cmos"] = GROUPS["x86"][:] + ["mips_loongson"]; GROUPS["cmos"].remove("i386_efi"); GROUPS["cmos"].remove("x86_64_efi")
GROUPS["pci"] = GROUPS["x86"] + GROUPS["mips"]
GROUPS["usb"] = GROUPS["pci"]
# If gfxterm is main output console integrate it into kernel
-GROUPS["videoinkernel"] = ["mips_yeeloong"]
+GROUPS["videoinkernel"] = ["mips_loongson"]
GROUPS["videomodules"] = GRUB_PLATFORMS[:];
for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
# Similar for terminfo
-GROUPS["terminfoinkernel"] = ["mips_yeeloong"] + GROUPS["ieee1275"];
+GROUPS["terminfoinkernel"] = ["mips_loongson"] + GROUPS["ieee1275"];
GROUPS["terminfomodule"] = GRUB_PLATFORMS[:];
for i in GROUPS["terminfoinkernel"]: GROUPS["terminfomodule"].remove(i)
# noemu = bus/usb/usbhub.c;
# enable = emu;
# enable = i386;
-# enable = mips_yeeloong;
+# enable = mips_loongson;
# emu_condition = COND_GRUB_EMU_USB;
# };
#
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
endif
-if COND_mips_yeeloong
+if COND_mips_loongson
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
i386_coreboot_ldflags = '-Wl,-Ttext=0x8200';
i386_multiboot_ldflags = '-Wl,-Ttext=0x8200';
i386_ieee1275_ldflags = '-Wl,-Ttext=0x10000';
- mips_yeeloong_ldflags = '-Wl,-Ttext,0x80200000';
+ mips_loongson_ldflags = '-Wl,-Ttext,0x80200000';
powerpc_ieee1275_ldflags = '-Wl,-Ttext,0x200000';
sparc64_ieee1275_ldflags = '-Wl,-Ttext,0x4400';
- mips_yeeloong_cppflags = '-DUSE_ASCII_FAILBACK';
+ mips_loongson_cppflags = '-DUSE_ASCII_FAILBACK';
i386_qemu_cppflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)';
emu_cflags = '$(CFLAGS_GNULIB)';
emu_cppflags = '$(CPPFLAGS_GNULIB)';
i386_ieee1275_startup = kern/i386/ieee1275/startup.S;
i386_coreboot_startup = kern/i386/coreboot/startup.S;
i386_multiboot_startup = kern/i386/coreboot/startup.S;
- mips_yeeloong_startup = kern/mips/startup.S;
+ mips_loongson_startup = kern/mips/startup.S;
sparc64_ieee1275_startup = kern/sparc64/ieee1275/crt0.S;
powerpc_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
i386_qemu = kern/generic/rtc_get_time_ms.c;
i386_coreboot = kern/generic/rtc_get_time_ms.c;
i386_multiboot = kern/generic/rtc_get_time_ms.c;
- mips_yeeloong = kern/generic/rtc_get_time_ms.c;
+ mips_loongson = kern/generic/rtc_get_time_ms.c;
ieee1275 = disk/ieee1275/ofdisk.c;
ieee1275 = kern/ieee1275/cmain.c;
i386_ieee1275 = kern/ieee1275/init.c;
- mips_yeeloong = term/ns8250.c;
- mips_yeeloong = bus/bonito.c;
- mips_yeeloong = bus/cs5536.c;
- mips_yeeloong = bus/pci.c;
- mips_yeeloong = kern/mips/cache.S;
- mips_yeeloong = kern/mips/dl.c;
- mips_yeeloong = kern/mips/init.c;
- mips_yeeloong = kern/mips/yeeloong/init.c;
- mips_yeeloong = term/at_keyboard.c;
- mips_yeeloong = term/serial.c;
- mips_yeeloong = video/sm712.c;
- mips_yeeloong = video/sis315pro.c;
+ mips_loongson = term/ns8250.c;
+ mips_loongson = bus/bonito.c;
+ mips_loongson = bus/cs5536.c;
+ mips_loongson = bus/pci.c;
+ mips_loongson = kern/mips/cache.S;
+ mips_loongson = kern/mips/dl.c;
+ mips_loongson = kern/mips/init.c;
+ mips_loongson = kern/mips/loongson/init.c;
+ mips_loongson = term/at_keyboard.c;
+ mips_loongson = term/serial.c;
+ mips_loongson = video/sm712.c;
+ mips_loongson = video/sis315pro.c;
extra_dist = video/sm712_init.c;
- mips_yeeloong = commands/keylayouts.c;
+ mips_loongson = commands/keylayouts.c;
powerpc_ieee1275 = kern/ieee1275/init.c;
powerpc_ieee1275 = kern/powerpc/cache.S;
image = {
name = fwstart;
- mips_yeeloong = boot/mips/yeeloong/fwstart.S;
+ mips_loongson = boot/mips/loongson/fwstart.S;
objcopyflags = '-O binary';
ldflags = '-static-libgcc -lgcc -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic';
- enable = mips_yeeloong;
+ enable = mips_loongson;
};
image = {
name = fwstart_fuloong;
- mips_yeeloong = boot/mips/yeeloong/fuloong.S;
+ mips_loongson = boot/mips/loongson/fuloong.S;
objcopyflags = '-O binary';
ldflags = '-static-libgcc -lgcc -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic';
- enable = mips_yeeloong;
+ enable = mips_loongson;
};
module = {
module = {
name = lsspd;
- mips_yeeloong = commands/mips/yeeloong/lsspd.c;
- enable = mips_yeeloong;
+ mips_loongson = commands/mips/loongson/lsspd.c;
+ enable = mips_loongson;
};
module = {
x86_efi = mmap/efi/mmap.c;
- mips_yeeloong = mmap/mips/yeeloong/uppermem.c;
+ mips_loongson = mmap/mips/loongson/uppermem.c;
enable = x86;
- enable = mips_yeeloong;
+ enable = mips_loongson;
};
module = {
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <grub/mips/yeeloong/serial.h>
-#include <grub/mips/yeeloong/pci.h>
+#include <grub/mips/loongson/serial.h>
+#include <grub/mips/loongson/pci.h>
#include <grub/mips/loongson.h>
#include <grub/pci.h>
#include <grub/machine/serial.h>
sb $t1, %lo(GRUB_MACHINE_PCI_IO_BASE + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL3) ($t0)
sb $t1, %lo(GRUB_MACHINE_PCI_IO_BASE + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL2) ($t0)
- /* Yeeloong has only one memory slot. */
+ /* Yeeloong and Fuloong have only one memory slot. */
/* Output first byte on serial for debugging. */
ori $a1, $zero, GRUB_SMB_RAM_START_ADDR
bal read_spd
/* Parse arguments. Has to be done before relocation.
So need to do it in asm. */
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
move $s2, $zero
move $s3, $zero
move $s4, $zero
}
/* #endif */
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
volatile void *
grub_dma_get_virt (struct grub_pci_dma_chunk *ch)
{
continue;
}
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
/* Skip ghosts. */
- if (id == GRUB_YEELOONG_OHCI_PCIID
- && dev.function == GRUB_YEELOONG_OHCI_GHOST_FUNCTION)
+ if (id == GRUB_LOONGSON_OHCI_PCIID
+ && dev.function == GRUB_LOONGSON_OHCI_GHOST_FUNCTION)
continue;
- if (id == GRUB_YEELOONG_EHCI_PCIID
- && dev.function == GRUB_YEELOONG_EHCI_GHOST_FUNCTION)
+ if (id == GRUB_LOONGSON_EHCI_PCIID
+ && dev.function == GRUB_LOONGSON_EHCI_GHOST_FUNCTION)
continue;
#endif
}
}
-/* This is actualy platform-independant but used only on yeeloong and sparc. */
-#if defined (GRUB_MACHINE_MIPS_YEELOONG) || defined (GRUB_MACHINE_SPARC64)
+/* This is actualy platform-independant but used only on loongson and sparc. */
+#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_SPARC64)
grub_addr_t
grub_modules_get_end (void)
{
/* FIXME: autoscan for BARs and devices. */
switch (pciid)
{
- case GRUB_YEELOONG_OHCI_PCIID:
+ case GRUB_LOONGSON_OHCI_PCIID:
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
grub_pci_write (addr, 0x5025000);
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
addr = grub_pci_make_address (dev, GRUB_PCI_REG_STATUS);
grub_pci_write_word (addr, 0x0200 | GRUB_PCI_STATUS_CAPABILITIES);
break;
- case GRUB_YEELOONG_EHCI_PCIID:
+ case GRUB_LOONGSON_EHCI_PCIID:
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
grub_pci_write (addr, 0x5026000);
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
if (err)
grub_fatal ("Couldn't init SMBus: %s\n", grub_errmsg);
- /* Yeeloong has only one memory slot. */
+ /* Yeeloong and Fuloong have only one memory slot. */
err = grub_cs5536_read_spd (smbbase, GRUB_SMB_RAM_START_ADDR, &spd);
if (err)
grub_fatal ("Couldn't read SPD: %s\n", grub_errmsg);
bal cont
nop
- . = _start + GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE
+ . = _start + GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE
total_module_size:
.long 0
*/
. = _start + GRUB_KERNEL_MACHINE_PREFIX_END
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
VARIABLE (grub_arch_busclock)
.long 0
VARIABLE (grub_arch_cpuclock)
/* Save our base. */
move $s0, $ra
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
lui $t1, %hi(grub_arch_busclock)
addiu $t1, %lo(grub_arch_busclock)
sw $s2, 0($t1)
#include <grub/pci.h>
#include <grub/machine/time.h>
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
#include <grub/machine/kernel.h>
const char loongson_machtypes[][60] =
/* For arguments. */
linux_argc = argc;
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
linux_argc++;
#endif
/* Main arguments. */
/* Normal arguments. */
for (i = 1; i < argc; i++)
size += ALIGN_UP (grub_strlen (argv[i]) + 1, 4);
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
size += ALIGN_UP (sizeof (loongson_machtypes[0]), 4);
#endif
linux_argv++;
linux_args += ALIGN_UP (sizeof ("a0"), 4);
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
{
unsigned mtype = grub_arch_machine;
if (mtype >= ARRAY_SIZE (loongson_machtypes))
grub_outb (c, KEYBOARD_REG_DATA);
}
-#if !defined (GRUB_MACHINE_MIPS_YEELOONG) && !defined (GRUB_MACHINE_QEMU)
+#if !defined (GRUB_MACHINE_MIPS_LOONGSON) && !defined (GRUB_MACHINE_QEMU)
static grub_uint8_t
grub_keyboard_controller_read (void)
keyboard_controller_wait_until_ready ();
grub_inb (KEYBOARD_REG_DATA);
}
-#if defined (GRUB_MACHINE_MIPS_YEELOONG) || defined (GRUB_MACHINE_QEMU)
+#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_QEMU)
grub_keyboard_controller_orig = 0;
grub_keyboard_orig_set = 2;
#else
for (i = 0; i < ARRAY_SIZE (divisor_tab); i++)
if (divisor_tab[i].speed == config->speed)
{
- /* internal UART in Yeeloong runs twice the usual rate. */
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+ /* internal Loongson UART runs twice the usual rate. */
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
if (port->port == 0xbff003f8)
return 2 * divisor_tab[i].div;
else
| stop_bits[port->config.stop_bits]);
grub_outb (status, port->port + UART_LCR);
- /* In Yeeloong serial port has only 3 wires. */
-#ifndef GRUB_MACHINE_MIPS_YEELOONG
+ /* On Loongson machines serial port has only 3 wires. */
+#ifndef GRUB_MACHINE_MIPS_LOONGSON
/* Enable the FIFO. */
grub_outb (UART_ENABLE_FIFO_TRIGGER1, port->port + UART_FCR);
#include <grub/extcmd.h>
#include <grub/i18n.h>
#include <grub/list.h>
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
#include <grub/machine/kernel.h>
#endif
port->term_in = in;
port->term_out = out;
grub_terminfo_output_register (out, "vt100");
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
if (grub_strcmp (port->name,
(grub_arch_machine == GRUB_ARCH_MACHINE_YEELOONG)
? "com0" : "com2") == 0)
#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
#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
#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
{
struct grub_serial_config config =
{
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
+#ifdef GRUB_MACHINE_MIPS_LOONGSON
.speed = 115200,
#else
.speed = 9600,
case "${target_cpu}-${platform}" in
sparc64-ieee1275) mkimage_target=sparc64-ieee1275-raw ;;
- mips-yeeloong) mkimage_target=mipsel-yeeloong-elf ;;
+ mips-loongson) mkimage_target=mipsel-loongson-elf ;;
*) mkimage_target="${target_cpu}-${platform}" ;;
esac
case "${target_cpu}-${platform}" in
i386-efi | x86_64-efi) imgext=efi ;;
- mips-yeeloong | i386-coreboot | i386-multiboot | i386-ieee1275 \
+ mips-loongson | i386-coreboot | i386-multiboot | i386-ieee1275 \
| powerpc-ieee1275) imgext=elf ;;
*) imgext=img ;;
esac
"$grub_mkimage" ${config_opt} -d "${pkglibdir}" -O ${mkimage_target} --output="${grubdir}/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1
# Backward-compatibility kludges
-if [ "${target_cpu}-${platform}" = "mips-yeeloong" ]; then
+if [ "${target_cpu}-${platform}" = "mips-loongson" ]; then
cp "${grubdir}/core.${imgext}" "${bootdir}"/grub.elf
elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]; then
cp "${grubdir}/core.${imgext}" "${grubdir}/grub"
enum {
IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT,
IMAGE_SPARC64_AOUT, IMAGE_SPARC64_RAW, IMAGE_I386_IEEE1275,
- IMAGE_YEELOONG_ELF, IMAGE_QEMU, IMAGE_PPC, IMAGE_YEELOONG_FLASH,
+ IMAGE_LOONGSON_ELF, IMAGE_QEMU, IMAGE_PPC, IMAGE_YEELOONG_FLASH,
IMAGE_FULOONG_FLASH, IMAGE_I386_PC_PXE
} id;
enum
.install_bsd_part = TARGET_NO_FIELD,
},
{
- .dirname = "mipsel-yeeloong",
+ .dirname = "mipsel-loongson",
.names = { "mipsel-yeeloong-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
.id = IMAGE_YEELOONG_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
- .prefix = GRUB_KERNEL_MIPS_YEELOONG_PREFIX,
- .prefix_end = GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END,
+ .prefix = GRUB_KERNEL_MIPS_LOONGSON_PREFIX,
+ .prefix_end = GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END,
.raw_size = 0,
- .total_module_size = GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE,
+ .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE,
.compressed_size = TARGET_NO_FIELD,
.kernel_image_size = TARGET_NO_FIELD,
.section_align = 1,
.vaddr_offset = 0,
.install_dos_part = TARGET_NO_FIELD,
.install_bsd_part = TARGET_NO_FIELD,
- .link_addr = GRUB_KERNEL_MIPS_YEELOONG_LINK_ADDR,
+ .link_addr = GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR,
.elf_target = EM_MIPS,
- .link_align = GRUB_KERNEL_MIPS_YEELOONG_LINK_ALIGN,
+ .link_align = GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN,
.default_compression = COMPRESSION_NONE
},
{
- .dirname = "mipsel-yeeloong",
+ .dirname = "mipsel-loongson",
.names = { "mipsel-fuloong-flash", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
.id = IMAGE_FULOONG_FLASH,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
- .prefix = GRUB_KERNEL_MIPS_YEELOONG_PREFIX,
- .prefix_end = GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END,
+ .prefix = GRUB_KERNEL_MIPS_LOONGSON_PREFIX,
+ .prefix_end = GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END,
.raw_size = 0,
- .total_module_size = GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE,
+ .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE,
.compressed_size = TARGET_NO_FIELD,
.kernel_image_size = TARGET_NO_FIELD,
.section_align = 1,
.vaddr_offset = 0,
.install_dos_part = TARGET_NO_FIELD,
.install_bsd_part = TARGET_NO_FIELD,
- .link_addr = GRUB_KERNEL_MIPS_YEELOONG_LINK_ADDR,
+ .link_addr = GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR,
.elf_target = EM_MIPS,
- .link_align = GRUB_KERNEL_MIPS_YEELOONG_LINK_ALIGN,
+ .link_align = GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN,
.default_compression = COMPRESSION_NONE
},
{
- .dirname = "mipsel-yeeloong",
+ .dirname = "mipsel-loongson",
.names = { "mipsel-loongson-elf", "mipsel-yeeloong-elf",
"mipsel-fuloong-elf", NULL },
.voidp_sizeof = 4,
.bigendian = 0,
- .id = IMAGE_YEELOONG_ELF,
+ .id = IMAGE_LOONGSON_ELF,
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
- .prefix = GRUB_KERNEL_MIPS_YEELOONG_PREFIX,
- .prefix_end = GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END,
+ .prefix = GRUB_KERNEL_MIPS_LOONGSON_PREFIX,
+ .prefix_end = GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END,
.raw_size = 0,
- .total_module_size = GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE,
+ .total_module_size = GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE,
.compressed_size = TARGET_NO_FIELD,
.kernel_image_size = TARGET_NO_FIELD,
.section_align = 1,
.vaddr_offset = 0,
.install_dos_part = TARGET_NO_FIELD,
.install_bsd_part = TARGET_NO_FIELD,
- .link_addr = GRUB_KERNEL_MIPS_YEELOONG_LINK_ADDR,
+ .link_addr = GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR,
.elf_target = EM_MIPS,
- .link_align = GRUB_KERNEL_MIPS_YEELOONG_LINK_ALIGN,
+ .link_align = GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN,
.default_compression = COMPRESSION_NONE
},
{
decompress_size = grub_util_get_image_size (decompress_path);
decompress_img = grub_util_read_image (decompress_path);
- *((grub_uint32_t *) (decompress_img + GRUB_KERNEL_MIPS_YEELOONG_COMPRESSED_SIZE))
+ *((grub_uint32_t *) (decompress_img + GRUB_KERNEL_MIPS_LOONGSON_COMPRESSED_SIZE))
= grub_host_to_target32 (core_size);
- *((grub_uint32_t *) (decompress_img + GRUB_KERNEL_MIPS_YEELOONG_UNCOMPRESSED_SIZE))
+ *((grub_uint32_t *) (decompress_img + GRUB_KERNEL_MIPS_LOONGSON_UNCOMPRESSED_SIZE))
= grub_host_to_target32 (kernel_size + total_module_size);
full_size = core_size + decompress_size;
core_size = rom_size;
}
break;
- case IMAGE_YEELOONG_ELF:
+ case IMAGE_LOONGSON_ELF:
case IMAGE_PPC:
case IMAGE_COREBOOT:
case IMAGE_I386_IEEE1275:
int header_size, footer_size = 0;
int phnum = 1;
- if (image_target->id != IMAGE_YEELOONG_ELF)
+ if (image_target->id != IMAGE_LOONGSON_ELF)
phnum += 2;
if (note)
/* No section headers. */
ehdr->e_shoff = grub_host_to_target32 (0);
- if (image_target->id == IMAGE_YEELOONG_ELF)
+ if (image_target->id == IMAGE_LOONGSON_ELF)
ehdr->e_shentsize = grub_host_to_target16 (0);
else
ehdr->e_shentsize = grub_host_to_target16 (sizeof (Elf32_Shdr));
phdr->p_offset = grub_host_to_target32 (header_size);
phdr->p_flags = grub_host_to_target32 (PF_R | PF_W | PF_X);
- if (image_target->id == IMAGE_YEELOONG_ELF)
+ if (image_target->id == IMAGE_LOONGSON_ELF)
target_addr = ALIGN_UP (image_target->link_addr
+ kernel_size + total_module_size, 32);
else
phdr->p_vaddr = grub_host_to_target32 (target_addr);
phdr->p_paddr = grub_host_to_target32 (target_addr);
phdr->p_align = grub_host_to_target32 (align > image_target->link_align ? align : image_target->link_align);
- if (image_target->id == IMAGE_YEELOONG_ELF)
+ if (image_target->id == IMAGE_LOONGSON_ELF)
ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER
| EF_MIPS_PIC | EF_MIPS_CPIC);
else
ehdr->e_flags = 0;
- if (image_target->id == IMAGE_YEELOONG_ELF)
+ if (image_target->id == IMAGE_LOONGSON_ELF)
{
phdr->p_filesz = grub_host_to_target32 (core_size);
phdr->p_memsz = grub_host_to_target32 (core_size);