Rename mipsel-yeeloong to mipsel-loongson
This commit is contained in:
parent
a9fa2a22d7
commit
54da1febce
30 changed files with 116 additions and 114 deletions
|
@ -21,7 +21,7 @@ endif
|
||||||
if COND_i386_ieee1275
|
if COND_i386_ieee1275
|
||||||
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
||||||
endif
|
endif
|
||||||
if COND_mips_yeeloong
|
if COND_mips_loongson
|
||||||
CFLAGS_PLATFORM += -mexplicit-relocs
|
CFLAGS_PLATFORM += -mexplicit-relocs
|
||||||
CPPFLAGS_PLATFORM = -DUSE_ASCII_FAILBACK
|
CPPFLAGS_PLATFORM = -DUSE_ASCII_FAILBACK
|
||||||
CCASFLAGS_PLATFORM = -march=mips3
|
CCASFLAGS_PLATFORM = -march=mips3
|
||||||
|
|
16
configure.ac
16
configure.ac
|
@ -96,7 +96,7 @@ if test "x$with_platform" = x; then
|
||||||
powerpc-*) platform=ieee1275 ;;
|
powerpc-*) platform=ieee1275 ;;
|
||||||
powerpc64-*) platform=ieee1275 ;;
|
powerpc64-*) platform=ieee1275 ;;
|
||||||
sparc64-*) platform=ieee1275 ;;
|
sparc64-*) platform=ieee1275 ;;
|
||||||
mips-*) platform=yeeloong ;;
|
mips-*) platform=loongson ;;
|
||||||
*) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
|
*) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
|
@ -123,7 +123,9 @@ case "$target_cpu"-"$platform" in
|
||||||
powerpc-ieee1275) ;;
|
powerpc-ieee1275) ;;
|
||||||
sparc64-ieee1275) ;;
|
sparc64-ieee1275) ;;
|
||||||
mips-qemu-mips) ;;
|
mips-qemu-mips) ;;
|
||||||
mips-yeeloong) ;;
|
mips-yeeloong) platform=loongson ;;
|
||||||
|
mips-fuloong) platform=loongson ;;
|
||||||
|
mips-loongson) ;;
|
||||||
*-emu) ;;
|
*-emu) ;;
|
||||||
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
|
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
|
||||||
esac
|
esac
|
||||||
|
@ -156,7 +158,7 @@ case "$platform" in
|
||||||
qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
|
qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
|
||||||
pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
|
pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
|
||||||
emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=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" ;;
|
qemu-mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
|
||||||
esac
|
esac
|
||||||
case "$target_cpu" in
|
case "$target_cpu" in
|
||||||
|
@ -219,8 +221,8 @@ for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xyeeloong ); then
|
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson ); then
|
||||||
AC_MSG_ERROR([qemu and yeeloong ports need unifont])
|
AC_MSG_ERROR([qemu and loongson ports need unifont])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST([FONT_SOURCE])
|
AC_SUBST([FONT_SOURCE])
|
||||||
|
@ -398,7 +400,7 @@ if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
|
||||||
TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
|
TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
|
||||||
fi
|
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], [
|
AC_CACHE_CHECK([whether -march=loongson2f works], [grub_cv_cc_march_loongson2f], [
|
||||||
SAVE_CFLAGS="$CFLAGS"
|
SAVE_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -march=loongson2f"
|
CFLAGS="$CFLAGS -march=loongson2f"
|
||||||
|
@ -941,7 +943,7 @@ AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform =
|
||||||
AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot])
|
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_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_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_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_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])
|
AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
|
||||||
|
|
12
gentpl.py
12
gentpl.py
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot",
|
GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot",
|
||||||
"i386_multiboot", "i386_ieee1275", "x86_64_efi",
|
"i386_multiboot", "i386_ieee1275", "x86_64_efi",
|
||||||
"mips_yeeloong", "sparc64_ieee1275",
|
"mips_loongson", "sparc64_ieee1275",
|
||||||
"powerpc_ieee1275" ]
|
"powerpc_ieee1275" ]
|
||||||
|
|
||||||
GROUPS = {}
|
GROUPS = {}
|
||||||
|
@ -17,7 +17,7 @@ GROUPS["common"] = GRUB_PLATFORMS[:]
|
||||||
GROUPS["i386"] = [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275" ]
|
GROUPS["i386"] = [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275" ]
|
||||||
GROUPS["x86_64"] = [ "x86_64_efi" ]
|
GROUPS["x86_64"] = [ "x86_64_efi" ]
|
||||||
GROUPS["x86"] = GROUPS["i386"] + GROUPS["x86_64"]
|
GROUPS["x86"] = GROUPS["i386"] + GROUPS["x86_64"]
|
||||||
GROUPS["mips"] = [ "mips_yeeloong" ]
|
GROUPS["mips"] = [ "mips_loongson" ]
|
||||||
GROUPS["sparc64"] = [ "sparc64_ieee1275" ]
|
GROUPS["sparc64"] = [ "sparc64_ieee1275" ]
|
||||||
GROUPS["powerpc"] = [ "powerpc_ieee1275" ]
|
GROUPS["powerpc"] = [ "powerpc_ieee1275" ]
|
||||||
|
|
||||||
|
@ -29,17 +29,17 @@ GROUPS["ieee1275"] = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275"
|
||||||
GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu")
|
GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu")
|
||||||
|
|
||||||
# Groups based on hardware features
|
# 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["pci"] = GROUPS["x86"] + GROUPS["mips"]
|
||||||
GROUPS["usb"] = GROUPS["pci"]
|
GROUPS["usb"] = GROUPS["pci"]
|
||||||
|
|
||||||
# If gfxterm is main output console integrate it into kernel
|
# If gfxterm is main output console integrate it into kernel
|
||||||
GROUPS["videoinkernel"] = ["mips_yeeloong"]
|
GROUPS["videoinkernel"] = ["mips_loongson"]
|
||||||
GROUPS["videomodules"] = GRUB_PLATFORMS[:];
|
GROUPS["videomodules"] = GRUB_PLATFORMS[:];
|
||||||
for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
|
for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
|
||||||
|
|
||||||
# Similar for terminfo
|
# Similar for terminfo
|
||||||
GROUPS["terminfoinkernel"] = ["mips_yeeloong"] + GROUPS["ieee1275"];
|
GROUPS["terminfoinkernel"] = ["mips_loongson"] + GROUPS["ieee1275"];
|
||||||
GROUPS["terminfomodule"] = GRUB_PLATFORMS[:];
|
GROUPS["terminfomodule"] = GRUB_PLATFORMS[:];
|
||||||
for i in GROUPS["terminfoinkernel"]: GROUPS["terminfomodule"].remove(i)
|
for i in GROUPS["terminfoinkernel"]: GROUPS["terminfomodule"].remove(i)
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ def foreach_enabled_platform(closure):
|
||||||
# noemu = bus/usb/usbhub.c;
|
# noemu = bus/usb/usbhub.c;
|
||||||
# enable = emu;
|
# enable = emu;
|
||||||
# enable = i386;
|
# enable = i386;
|
||||||
# enable = mips_yeeloong;
|
# enable = mips_loongson;
|
||||||
# emu_condition = COND_GRUB_EMU_USB;
|
# emu_condition = COND_GRUB_EMU_USB;
|
||||||
# };
|
# };
|
||||||
#
|
#
|
||||||
|
|
|
@ -125,7 +125,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
|
||||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
||||||
endif
|
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/keyboard_layouts.h
|
||||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
||||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
|
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
|
||||||
|
|
|
@ -32,11 +32,11 @@ kernel = {
|
||||||
i386_coreboot_ldflags = '-Wl,-Ttext=0x8200';
|
i386_coreboot_ldflags = '-Wl,-Ttext=0x8200';
|
||||||
i386_multiboot_ldflags = '-Wl,-Ttext=0x8200';
|
i386_multiboot_ldflags = '-Wl,-Ttext=0x8200';
|
||||||
i386_ieee1275_ldflags = '-Wl,-Ttext=0x10000';
|
i386_ieee1275_ldflags = '-Wl,-Ttext=0x10000';
|
||||||
mips_yeeloong_ldflags = '-Wl,-Ttext,0x80200000';
|
mips_loongson_ldflags = '-Wl,-Ttext,0x80200000';
|
||||||
powerpc_ieee1275_ldflags = '-Wl,-Ttext,0x200000';
|
powerpc_ieee1275_ldflags = '-Wl,-Ttext,0x200000';
|
||||||
sparc64_ieee1275_ldflags = '-Wl,-Ttext,0x4400';
|
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)';
|
i386_qemu_cppflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)';
|
||||||
emu_cflags = '$(CFLAGS_GNULIB)';
|
emu_cflags = '$(CFLAGS_GNULIB)';
|
||||||
emu_cppflags = '$(CPPFLAGS_GNULIB)';
|
emu_cppflags = '$(CPPFLAGS_GNULIB)';
|
||||||
|
@ -48,7 +48,7 @@ kernel = {
|
||||||
i386_ieee1275_startup = kern/i386/ieee1275/startup.S;
|
i386_ieee1275_startup = kern/i386/ieee1275/startup.S;
|
||||||
i386_coreboot_startup = kern/i386/coreboot/startup.S;
|
i386_coreboot_startup = kern/i386/coreboot/startup.S;
|
||||||
i386_multiboot_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;
|
sparc64_ieee1275_startup = kern/sparc64/ieee1275/crt0.S;
|
||||||
powerpc_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
|
powerpc_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ kernel = {
|
||||||
i386_qemu = kern/generic/rtc_get_time_ms.c;
|
i386_qemu = kern/generic/rtc_get_time_ms.c;
|
||||||
i386_coreboot = 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;
|
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 = disk/ieee1275/ofdisk.c;
|
||||||
ieee1275 = kern/ieee1275/cmain.c;
|
ieee1275 = kern/ieee1275/cmain.c;
|
||||||
|
@ -136,20 +136,20 @@ kernel = {
|
||||||
|
|
||||||
i386_ieee1275 = kern/ieee1275/init.c;
|
i386_ieee1275 = kern/ieee1275/init.c;
|
||||||
|
|
||||||
mips_yeeloong = term/ns8250.c;
|
mips_loongson = term/ns8250.c;
|
||||||
mips_yeeloong = bus/bonito.c;
|
mips_loongson = bus/bonito.c;
|
||||||
mips_yeeloong = bus/cs5536.c;
|
mips_loongson = bus/cs5536.c;
|
||||||
mips_yeeloong = bus/pci.c;
|
mips_loongson = bus/pci.c;
|
||||||
mips_yeeloong = kern/mips/cache.S;
|
mips_loongson = kern/mips/cache.S;
|
||||||
mips_yeeloong = kern/mips/dl.c;
|
mips_loongson = kern/mips/dl.c;
|
||||||
mips_yeeloong = kern/mips/init.c;
|
mips_loongson = kern/mips/init.c;
|
||||||
mips_yeeloong = kern/mips/yeeloong/init.c;
|
mips_loongson = kern/mips/loongson/init.c;
|
||||||
mips_yeeloong = term/at_keyboard.c;
|
mips_loongson = term/at_keyboard.c;
|
||||||
mips_yeeloong = term/serial.c;
|
mips_loongson = term/serial.c;
|
||||||
mips_yeeloong = video/sm712.c;
|
mips_loongson = video/sm712.c;
|
||||||
mips_yeeloong = video/sis315pro.c;
|
mips_loongson = video/sis315pro.c;
|
||||||
extra_dist = video/sm712_init.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/ieee1275/init.c;
|
||||||
powerpc_ieee1275 = kern/powerpc/cache.S;
|
powerpc_ieee1275 = kern/powerpc/cache.S;
|
||||||
|
@ -323,18 +323,18 @@ image = {
|
||||||
|
|
||||||
image = {
|
image = {
|
||||||
name = fwstart;
|
name = fwstart;
|
||||||
mips_yeeloong = boot/mips/yeeloong/fwstart.S;
|
mips_loongson = boot/mips/loongson/fwstart.S;
|
||||||
objcopyflags = '-O binary';
|
objcopyflags = '-O binary';
|
||||||
ldflags = '-static-libgcc -lgcc -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic';
|
ldflags = '-static-libgcc -lgcc -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic';
|
||||||
enable = mips_yeeloong;
|
enable = mips_loongson;
|
||||||
};
|
};
|
||||||
|
|
||||||
image = {
|
image = {
|
||||||
name = fwstart_fuloong;
|
name = fwstart_fuloong;
|
||||||
mips_yeeloong = boot/mips/yeeloong/fuloong.S;
|
mips_loongson = boot/mips/loongson/fuloong.S;
|
||||||
objcopyflags = '-O binary';
|
objcopyflags = '-O binary';
|
||||||
ldflags = '-static-libgcc -lgcc -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic';
|
ldflags = '-static-libgcc -lgcc -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic';
|
||||||
enable = mips_yeeloong;
|
enable = mips_loongson;
|
||||||
};
|
};
|
||||||
|
|
||||||
module = {
|
module = {
|
||||||
|
@ -358,8 +358,8 @@ module = {
|
||||||
|
|
||||||
module = {
|
module = {
|
||||||
name = lsspd;
|
name = lsspd;
|
||||||
mips_yeeloong = commands/mips/yeeloong/lsspd.c;
|
mips_loongson = commands/mips/loongson/lsspd.c;
|
||||||
enable = mips_yeeloong;
|
enable = mips_loongson;
|
||||||
};
|
};
|
||||||
|
|
||||||
module = {
|
module = {
|
||||||
|
@ -1236,10 +1236,10 @@ module = {
|
||||||
|
|
||||||
x86_efi = mmap/efi/mmap.c;
|
x86_efi = mmap/efi/mmap.c;
|
||||||
|
|
||||||
mips_yeeloong = mmap/mips/yeeloong/uppermem.c;
|
mips_loongson = mmap/mips/loongson/uppermem.c;
|
||||||
|
|
||||||
enable = x86;
|
enable = x86;
|
||||||
enable = mips_yeeloong;
|
enable = mips_loongson;
|
||||||
};
|
};
|
||||||
|
|
||||||
module = {
|
module = {
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <grub/mips/yeeloong/serial.h>
|
#include <grub/mips/loongson/serial.h>
|
||||||
#include <grub/mips/yeeloong/pci.h>
|
#include <grub/mips/loongson/pci.h>
|
||||||
#include <grub/mips/loongson.h>
|
#include <grub/mips/loongson.h>
|
||||||
#include <grub/pci.h>
|
#include <grub/pci.h>
|
||||||
#include <grub/machine/serial.h>
|
#include <grub/machine/serial.h>
|
||||||
|
@ -129,7 +129,7 @@ retry_cs5536:
|
||||||
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_CTRL3) ($t0)
|
||||||
sb $t1, %lo(GRUB_MACHINE_PCI_IO_BASE + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL2) ($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. */
|
/* Output first byte on serial for debugging. */
|
||||||
ori $a1, $zero, GRUB_SMB_RAM_START_ADDR
|
ori $a1, $zero, GRUB_SMB_RAM_START_ADDR
|
||||||
bal read_spd
|
bal read_spd
|
|
@ -50,7 +50,7 @@ codestart:
|
||||||
|
|
||||||
/* Parse arguments. Has to be done before relocation.
|
/* Parse arguments. Has to be done before relocation.
|
||||||
So need to do it in asm. */
|
So need to do it in asm. */
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
move $s2, $zero
|
move $s2, $zero
|
||||||
move $s3, $zero
|
move $s3, $zero
|
||||||
move $s4, $zero
|
move $s4, $zero
|
||||||
|
|
|
@ -36,7 +36,7 @@ grub_dma_free (struct grub_pci_dma_chunk *ch)
|
||||||
}
|
}
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
volatile void *
|
volatile void *
|
||||||
grub_dma_get_virt (struct grub_pci_dma_chunk *ch)
|
grub_dma_get_virt (struct grub_pci_dma_chunk *ch)
|
||||||
{
|
{
|
||||||
|
@ -99,13 +99,13 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
/* Skip ghosts. */
|
/* Skip ghosts. */
|
||||||
if (id == GRUB_YEELOONG_OHCI_PCIID
|
if (id == GRUB_LOONGSON_OHCI_PCIID
|
||||||
&& dev.function == GRUB_YEELOONG_OHCI_GHOST_FUNCTION)
|
&& dev.function == GRUB_LOONGSON_OHCI_GHOST_FUNCTION)
|
||||||
continue;
|
continue;
|
||||||
if (id == GRUB_YEELOONG_EHCI_PCIID
|
if (id == GRUB_LOONGSON_EHCI_PCIID
|
||||||
&& dev.function == GRUB_YEELOONG_EHCI_GHOST_FUNCTION)
|
&& dev.function == GRUB_LOONGSON_EHCI_GHOST_FUNCTION)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -53,8 +53,8 @@ grub_module_iterate (int (*hook) (struct grub_module_header *header))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is actualy platform-independant but used only on yeeloong and sparc. */
|
/* This is actualy platform-independant but used only on loongson and sparc. */
|
||||||
#if defined (GRUB_MACHINE_MIPS_YEELOONG) || defined (GRUB_MACHINE_SPARC64)
|
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_SPARC64)
|
||||||
grub_addr_t
|
grub_addr_t
|
||||||
grub_modules_get_end (void)
|
grub_modules_get_end (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,7 +80,7 @@ init_pci (void)
|
||||||
/* FIXME: autoscan for BARs and devices. */
|
/* FIXME: autoscan for BARs and devices. */
|
||||||
switch (pciid)
|
switch (pciid)
|
||||||
{
|
{
|
||||||
case GRUB_YEELOONG_OHCI_PCIID:
|
case GRUB_LOONGSON_OHCI_PCIID:
|
||||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
|
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
|
||||||
grub_pci_write (addr, 0x5025000);
|
grub_pci_write (addr, 0x5025000);
|
||||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
||||||
|
@ -92,7 +92,7 @@ init_pci (void)
|
||||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_STATUS);
|
addr = grub_pci_make_address (dev, GRUB_PCI_REG_STATUS);
|
||||||
grub_pci_write_word (addr, 0x0200 | GRUB_PCI_STATUS_CAPABILITIES);
|
grub_pci_write_word (addr, 0x0200 | GRUB_PCI_STATUS_CAPABILITIES);
|
||||||
break;
|
break;
|
||||||
case GRUB_YEELOONG_EHCI_PCIID:
|
case GRUB_LOONGSON_EHCI_PCIID:
|
||||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
|
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
|
||||||
grub_pci_write (addr, 0x5026000);
|
grub_pci_write (addr, 0x5026000);
|
||||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
||||||
|
@ -164,7 +164,7 @@ grub_machine_init (void)
|
||||||
if (err)
|
if (err)
|
||||||
grub_fatal ("Couldn't init SMBus: %s\n", grub_errmsg);
|
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);
|
err = grub_cs5536_read_spd (smbbase, GRUB_SMB_RAM_START_ADDR, &spd);
|
||||||
if (err)
|
if (err)
|
||||||
grub_fatal ("Couldn't read SPD: %s\n", grub_errmsg);
|
grub_fatal ("Couldn't read SPD: %s\n", grub_errmsg);
|
|
@ -36,7 +36,7 @@ start:
|
||||||
bal cont
|
bal cont
|
||||||
nop
|
nop
|
||||||
|
|
||||||
. = _start + GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE
|
. = _start + GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE
|
||||||
total_module_size:
|
total_module_size:
|
||||||
.long 0
|
.long 0
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ VARIABLE(grub_prefix)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
. = _start + GRUB_KERNEL_MACHINE_PREFIX_END
|
. = _start + GRUB_KERNEL_MACHINE_PREFIX_END
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
VARIABLE (grub_arch_busclock)
|
VARIABLE (grub_arch_busclock)
|
||||||
.long 0
|
.long 0
|
||||||
VARIABLE (grub_arch_cpuclock)
|
VARIABLE (grub_arch_cpuclock)
|
||||||
|
@ -67,7 +67,7 @@ cont:
|
||||||
/* Save our base. */
|
/* Save our base. */
|
||||||
move $s0, $ra
|
move $s0, $ra
|
||||||
|
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
lui $t1, %hi(grub_arch_busclock)
|
lui $t1, %hi(grub_arch_busclock)
|
||||||
addiu $t1, %lo(grub_arch_busclock)
|
addiu $t1, %lo(grub_arch_busclock)
|
||||||
sw $s2, 0($t1)
|
sw $s2, 0($t1)
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include <grub/pci.h>
|
#include <grub/pci.h>
|
||||||
#include <grub/machine/time.h>
|
#include <grub/machine/time.h>
|
||||||
|
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
#include <grub/machine/kernel.h>
|
#include <grub/machine/kernel.h>
|
||||||
|
|
||||||
const char loongson_machtypes[][60] =
|
const char loongson_machtypes[][60] =
|
||||||
|
@ -224,7 +224,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
||||||
|
|
||||||
/* For arguments. */
|
/* For arguments. */
|
||||||
linux_argc = argc;
|
linux_argc = argc;
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
linux_argc++;
|
linux_argc++;
|
||||||
#endif
|
#endif
|
||||||
/* Main arguments. */
|
/* Main arguments. */
|
||||||
|
@ -239,7 +239,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
||||||
/* Normal arguments. */
|
/* Normal arguments. */
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
size += ALIGN_UP (grub_strlen (argv[i]) + 1, 4);
|
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);
|
size += ALIGN_UP (sizeof (loongson_machtypes[0]), 4);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
||||||
linux_argv++;
|
linux_argv++;
|
||||||
linux_args += ALIGN_UP (sizeof ("a0"), 4);
|
linux_args += ALIGN_UP (sizeof ("a0"), 4);
|
||||||
|
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
{
|
{
|
||||||
unsigned mtype = grub_arch_machine;
|
unsigned mtype = grub_arch_machine;
|
||||||
if (mtype >= ARRAY_SIZE (loongson_machtypes))
|
if (mtype >= ARRAY_SIZE (loongson_machtypes))
|
||||||
|
|
|
@ -257,7 +257,7 @@ grub_keyboard_controller_write (grub_uint8_t c)
|
||||||
grub_outb (c, KEYBOARD_REG_DATA);
|
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
|
static grub_uint8_t
|
||||||
grub_keyboard_controller_read (void)
|
grub_keyboard_controller_read (void)
|
||||||
|
@ -562,7 +562,7 @@ grub_keyboard_controller_init (struct grub_term_input *term __attribute__ ((unus
|
||||||
keyboard_controller_wait_until_ready ();
|
keyboard_controller_wait_until_ready ();
|
||||||
grub_inb (KEYBOARD_REG_DATA);
|
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_controller_orig = 0;
|
||||||
grub_keyboard_orig_set = 2;
|
grub_keyboard_orig_set = 2;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -66,8 +66,8 @@ serial_get_divisor (const struct grub_serial_port *port,
|
||||||
for (i = 0; i < ARRAY_SIZE (divisor_tab); i++)
|
for (i = 0; i < ARRAY_SIZE (divisor_tab); i++)
|
||||||
if (divisor_tab[i].speed == config->speed)
|
if (divisor_tab[i].speed == config->speed)
|
||||||
{
|
{
|
||||||
/* internal UART in Yeeloong runs twice the usual rate. */
|
/* internal Loongson UART runs twice the usual rate. */
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
if (port->port == 0xbff003f8)
|
if (port->port == 0xbff003f8)
|
||||||
return 2 * divisor_tab[i].div;
|
return 2 * divisor_tab[i].div;
|
||||||
else
|
else
|
||||||
|
@ -115,8 +115,8 @@ do_real_config (struct grub_serial_port *port)
|
||||||
| stop_bits[port->config.stop_bits]);
|
| stop_bits[port->config.stop_bits]);
|
||||||
grub_outb (status, port->port + UART_LCR);
|
grub_outb (status, port->port + UART_LCR);
|
||||||
|
|
||||||
/* In Yeeloong serial port has only 3 wires. */
|
/* On Loongson machines serial port has only 3 wires. */
|
||||||
#ifndef GRUB_MACHINE_MIPS_YEELOONG
|
#ifndef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
/* Enable the FIFO. */
|
/* Enable the FIFO. */
|
||||||
grub_outb (UART_ENABLE_FIFO_TRIGGER1, port->port + UART_FCR);
|
grub_outb (UART_ENABLE_FIFO_TRIGGER1, port->port + UART_FCR);
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <grub/extcmd.h>
|
#include <grub/extcmd.h>
|
||||||
#include <grub/i18n.h>
|
#include <grub/i18n.h>
|
||||||
#include <grub/list.h>
|
#include <grub/list.h>
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
#include <grub/machine/kernel.h>
|
#include <grub/machine/kernel.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ grub_serial_register (struct grub_serial_port *port)
|
||||||
port->term_in = in;
|
port->term_in = in;
|
||||||
port->term_out = out;
|
port->term_out = out;
|
||||||
grub_terminfo_output_register (out, "vt100");
|
grub_terminfo_output_register (out, "vt100");
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
if (grub_strcmp (port->name,
|
if (grub_strcmp (port->name,
|
||||||
(grub_arch_machine == GRUB_ARCH_MACHINE_YEELOONG)
|
(grub_arch_machine == GRUB_ARCH_MACHINE_YEELOONG)
|
||||||
? "com0" : "com2") == 0)
|
? "com0" : "com2") == 0)
|
||||||
|
|
|
@ -24,10 +24,10 @@
|
||||||
#include <grub/cpu/io.h>
|
#include <grub/cpu/io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GRUB_YEELOONG_OHCI_PCIID 0x00351033
|
#define GRUB_LOONGSON_OHCI_PCIID 0x00351033
|
||||||
#define GRUB_YEELOONG_EHCI_PCIID 0x00e01033
|
#define GRUB_LOONGSON_EHCI_PCIID 0x00e01033
|
||||||
#define GRUB_YEELOONG_OHCI_GHOST_FUNCTION 4
|
#define GRUB_LOONGSON_OHCI_GHOST_FUNCTION 4
|
||||||
#define GRUB_YEELOONG_EHCI_GHOST_FUNCTION 5
|
#define GRUB_LOONGSON_EHCI_GHOST_FUNCTION 5
|
||||||
|
|
||||||
#define GRUB_PCI_NUM_BUS 1
|
#define GRUB_PCI_NUM_BUS 1
|
||||||
#define GRUB_PCI_NUM_DEVICES 16
|
#define GRUB_PCI_NUM_DEVICES 16
|
|
@ -100,16 +100,16 @@
|
||||||
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4
|
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4
|
||||||
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR 0x200000
|
#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_LOONGSON_COMPRESSED_SIZE 0x8
|
||||||
#define GRUB_KERNEL_MIPS_YEELOONG_UNCOMPRESSED_SIZE 0xc
|
#define GRUB_KERNEL_MIPS_LOONGSON_UNCOMPRESSED_SIZE 0xc
|
||||||
|
|
||||||
#define GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE 0x08
|
#define GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE 0x08
|
||||||
#define GRUB_KERNEL_MIPS_YEELOONG_PREFIX 0x0c
|
#define GRUB_KERNEL_MIPS_LOONGSON_PREFIX 0x0c
|
||||||
#define GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END 0x54
|
#define GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END 0x54
|
||||||
|
|
||||||
/* The offset of GRUB_PREFIX. */
|
/* The offset of GRUB_PREFIX. */
|
||||||
#define GRUB_KERNEL_I386_EFI_PREFIX 0x8
|
#define GRUB_KERNEL_I386_EFI_PREFIX 0x8
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
|
|
||||||
#define GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN 0x1000
|
#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
|
/* 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
|
for PowerMac to prevent "CLAIM failed" error. The real fix is to
|
||||||
|
|
|
@ -102,7 +102,7 @@ grub_serial_config_defaults (struct grub_serial_port *port)
|
||||||
{
|
{
|
||||||
struct grub_serial_config config =
|
struct grub_serial_config config =
|
||||||
{
|
{
|
||||||
#ifdef GRUB_MACHINE_MIPS_YEELOONG
|
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||||
.speed = 115200,
|
.speed = 115200,
|
||||||
#else
|
#else
|
||||||
.speed = 9600,
|
.speed = 9600,
|
||||||
|
|
|
@ -551,13 +551,13 @@ fi
|
||||||
|
|
||||||
case "${target_cpu}-${platform}" in
|
case "${target_cpu}-${platform}" in
|
||||||
sparc64-ieee1275) mkimage_target=sparc64-ieee1275-raw ;;
|
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}" ;;
|
*) mkimage_target="${target_cpu}-${platform}" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "${target_cpu}-${platform}" in
|
case "${target_cpu}-${platform}" in
|
||||||
i386-efi | x86_64-efi) imgext=efi ;;
|
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 ;;
|
| powerpc-ieee1275) imgext=elf ;;
|
||||||
*) imgext=img ;;
|
*) imgext=img ;;
|
||||||
esac
|
esac
|
||||||
|
@ -566,7 +566,7 @@ esac
|
||||||
"$grub_mkimage" ${config_opt} -d "${pkglibdir}" -O ${mkimage_target} --output="${grubdir}/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1
|
"$grub_mkimage" ${config_opt} -d "${pkglibdir}" -O ${mkimage_target} --output="${grubdir}/core.${imgext}" --prefix="${prefix_drive}${relative_grubdir}" $modules || exit 1
|
||||||
|
|
||||||
# Backward-compatibility kludges
|
# Backward-compatibility kludges
|
||||||
if [ "${target_cpu}-${platform}" = "mips-yeeloong" ]; then
|
if [ "${target_cpu}-${platform}" = "mips-loongson" ]; then
|
||||||
cp "${grubdir}/core.${imgext}" "${bootdir}"/grub.elf
|
cp "${grubdir}/core.${imgext}" "${bootdir}"/grub.elf
|
||||||
elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]; then
|
elif [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ]; then
|
||||||
cp "${grubdir}/core.${imgext}" "${grubdir}/grub"
|
cp "${grubdir}/core.${imgext}" "${grubdir}/grub"
|
||||||
|
|
|
@ -65,7 +65,7 @@ struct image_target_desc
|
||||||
enum {
|
enum {
|
||||||
IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT,
|
IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT,
|
||||||
IMAGE_SPARC64_AOUT, IMAGE_SPARC64_RAW, IMAGE_I386_IEEE1275,
|
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
|
IMAGE_FULOONG_FLASH, IMAGE_I386_PC_PXE
|
||||||
} id;
|
} id;
|
||||||
enum
|
enum
|
||||||
|
@ -265,70 +265,70 @@ struct image_target_desc image_targets[] =
|
||||||
.install_bsd_part = TARGET_NO_FIELD,
|
.install_bsd_part = TARGET_NO_FIELD,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.dirname = "mipsel-yeeloong",
|
.dirname = "mipsel-loongson",
|
||||||
.names = { "mipsel-yeeloong-flash", NULL },
|
.names = { "mipsel-yeeloong-flash", NULL },
|
||||||
.voidp_sizeof = 4,
|
.voidp_sizeof = 4,
|
||||||
.bigendian = 0,
|
.bigendian = 0,
|
||||||
.id = IMAGE_YEELOONG_FLASH,
|
.id = IMAGE_YEELOONG_FLASH,
|
||||||
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
|
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
|
||||||
.prefix = GRUB_KERNEL_MIPS_YEELOONG_PREFIX,
|
.prefix = GRUB_KERNEL_MIPS_LOONGSON_PREFIX,
|
||||||
.prefix_end = GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END,
|
.prefix_end = GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END,
|
||||||
.raw_size = 0,
|
.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,
|
.compressed_size = TARGET_NO_FIELD,
|
||||||
.kernel_image_size = TARGET_NO_FIELD,
|
.kernel_image_size = TARGET_NO_FIELD,
|
||||||
.section_align = 1,
|
.section_align = 1,
|
||||||
.vaddr_offset = 0,
|
.vaddr_offset = 0,
|
||||||
.install_dos_part = TARGET_NO_FIELD,
|
.install_dos_part = TARGET_NO_FIELD,
|
||||||
.install_bsd_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,
|
.elf_target = EM_MIPS,
|
||||||
.link_align = GRUB_KERNEL_MIPS_YEELOONG_LINK_ALIGN,
|
.link_align = GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN,
|
||||||
.default_compression = COMPRESSION_NONE
|
.default_compression = COMPRESSION_NONE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.dirname = "mipsel-yeeloong",
|
.dirname = "mipsel-loongson",
|
||||||
.names = { "mipsel-fuloong-flash", NULL },
|
.names = { "mipsel-fuloong-flash", NULL },
|
||||||
.voidp_sizeof = 4,
|
.voidp_sizeof = 4,
|
||||||
.bigendian = 0,
|
.bigendian = 0,
|
||||||
.id = IMAGE_FULOONG_FLASH,
|
.id = IMAGE_FULOONG_FLASH,
|
||||||
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
|
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
|
||||||
.prefix = GRUB_KERNEL_MIPS_YEELOONG_PREFIX,
|
.prefix = GRUB_KERNEL_MIPS_LOONGSON_PREFIX,
|
||||||
.prefix_end = GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END,
|
.prefix_end = GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END,
|
||||||
.raw_size = 0,
|
.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,
|
.compressed_size = TARGET_NO_FIELD,
|
||||||
.kernel_image_size = TARGET_NO_FIELD,
|
.kernel_image_size = TARGET_NO_FIELD,
|
||||||
.section_align = 1,
|
.section_align = 1,
|
||||||
.vaddr_offset = 0,
|
.vaddr_offset = 0,
|
||||||
.install_dos_part = TARGET_NO_FIELD,
|
.install_dos_part = TARGET_NO_FIELD,
|
||||||
.install_bsd_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,
|
.elf_target = EM_MIPS,
|
||||||
.link_align = GRUB_KERNEL_MIPS_YEELOONG_LINK_ALIGN,
|
.link_align = GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN,
|
||||||
.default_compression = COMPRESSION_NONE
|
.default_compression = COMPRESSION_NONE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.dirname = "mipsel-yeeloong",
|
.dirname = "mipsel-loongson",
|
||||||
.names = { "mipsel-loongson-elf", "mipsel-yeeloong-elf",
|
.names = { "mipsel-loongson-elf", "mipsel-yeeloong-elf",
|
||||||
"mipsel-fuloong-elf", NULL },
|
"mipsel-fuloong-elf", NULL },
|
||||||
.voidp_sizeof = 4,
|
.voidp_sizeof = 4,
|
||||||
.bigendian = 0,
|
.bigendian = 0,
|
||||||
.id = IMAGE_YEELOONG_ELF,
|
.id = IMAGE_LOONGSON_ELF,
|
||||||
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
|
.flags = PLATFORM_FLAGS_DECOMPRESSORS,
|
||||||
.prefix = GRUB_KERNEL_MIPS_YEELOONG_PREFIX,
|
.prefix = GRUB_KERNEL_MIPS_LOONGSON_PREFIX,
|
||||||
.prefix_end = GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END,
|
.prefix_end = GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END,
|
||||||
.raw_size = 0,
|
.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,
|
.compressed_size = TARGET_NO_FIELD,
|
||||||
.kernel_image_size = TARGET_NO_FIELD,
|
.kernel_image_size = TARGET_NO_FIELD,
|
||||||
.section_align = 1,
|
.section_align = 1,
|
||||||
.vaddr_offset = 0,
|
.vaddr_offset = 0,
|
||||||
.install_dos_part = TARGET_NO_FIELD,
|
.install_dos_part = TARGET_NO_FIELD,
|
||||||
.install_bsd_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,
|
.elf_target = EM_MIPS,
|
||||||
.link_align = GRUB_KERNEL_MIPS_YEELOONG_LINK_ALIGN,
|
.link_align = GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN,
|
||||||
.default_compression = COMPRESSION_NONE
|
.default_compression = COMPRESSION_NONE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -837,10 +837,10 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
||||||
decompress_size = grub_util_get_image_size (decompress_path);
|
decompress_size = grub_util_get_image_size (decompress_path);
|
||||||
decompress_img = grub_util_read_image (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_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);
|
= grub_host_to_target32 (kernel_size + total_module_size);
|
||||||
|
|
||||||
full_size = core_size + decompress_size;
|
full_size = core_size + decompress_size;
|
||||||
|
@ -1271,7 +1271,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
||||||
core_size = rom_size;
|
core_size = rom_size;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IMAGE_YEELOONG_ELF:
|
case IMAGE_LOONGSON_ELF:
|
||||||
case IMAGE_PPC:
|
case IMAGE_PPC:
|
||||||
case IMAGE_COREBOOT:
|
case IMAGE_COREBOOT:
|
||||||
case IMAGE_I386_IEEE1275:
|
case IMAGE_I386_IEEE1275:
|
||||||
|
@ -1284,7 +1284,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
||||||
int header_size, footer_size = 0;
|
int header_size, footer_size = 0;
|
||||||
int phnum = 1;
|
int phnum = 1;
|
||||||
|
|
||||||
if (image_target->id != IMAGE_YEELOONG_ELF)
|
if (image_target->id != IMAGE_LOONGSON_ELF)
|
||||||
phnum += 2;
|
phnum += 2;
|
||||||
|
|
||||||
if (note)
|
if (note)
|
||||||
|
@ -1319,7 +1319,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
||||||
|
|
||||||
/* No section headers. */
|
/* No section headers. */
|
||||||
ehdr->e_shoff = grub_host_to_target32 (0);
|
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);
|
ehdr->e_shentsize = grub_host_to_target16 (0);
|
||||||
else
|
else
|
||||||
ehdr->e_shentsize = grub_host_to_target16 (sizeof (Elf32_Shdr));
|
ehdr->e_shentsize = grub_host_to_target16 (sizeof (Elf32_Shdr));
|
||||||
|
@ -1332,7 +1332,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
||||||
phdr->p_offset = grub_host_to_target32 (header_size);
|
phdr->p_offset = grub_host_to_target32 (header_size);
|
||||||
phdr->p_flags = grub_host_to_target32 (PF_R | PF_W | PF_X);
|
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
|
target_addr = ALIGN_UP (image_target->link_addr
|
||||||
+ kernel_size + total_module_size, 32);
|
+ kernel_size + total_module_size, 32);
|
||||||
else
|
else
|
||||||
|
@ -1341,12 +1341,12 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
||||||
phdr->p_vaddr = grub_host_to_target32 (target_addr);
|
phdr->p_vaddr = grub_host_to_target32 (target_addr);
|
||||||
phdr->p_paddr = 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);
|
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
|
ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER
|
||||||
| EF_MIPS_PIC | EF_MIPS_CPIC);
|
| EF_MIPS_PIC | EF_MIPS_CPIC);
|
||||||
else
|
else
|
||||||
ehdr->e_flags = 0;
|
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_filesz = grub_host_to_target32 (core_size);
|
||||||
phdr->p_memsz = grub_host_to_target32 (core_size);
|
phdr->p_memsz = grub_host_to_target32 (core_size);
|
||||||
|
|
Loading…
Reference in a new issue