loongarch: kernel: Adapt for LoongArch

It was done by checkout chapter10/kernel.xml from arm64 branch and
perform some tiny adjustment :).
This commit is contained in:
Xi Ruoyao 2023-06-12 03:32:07 +08:00
parent 789161669f
commit 58962f760b
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3

View File

@ -141,6 +141,9 @@ General architecture-dependent options --->
[*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR]
[*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG] [*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG]
Device Drivers ---> Device Drivers --->
Firmware Drivers --->
EFI (Extensible Firmware Interface) Support --->
[*] Enable the generic EFI decompressor [CONFIG_EFI_ZBOOT]
Graphics support ---> Graphics support --->
Frame buffer Devices ---> Frame buffer Devices --->
<*> Support for frame buffer devices ---> <*> Support for frame buffer devices --->
@ -182,6 +185,8 @@ Device Drivers --->
[ ] Enable the firmware sysfs fallback mechanism [CONFIG_FW_LOADER_USER_HELPER] [ ] Enable the firmware sysfs fallback mechanism [CONFIG_FW_LOADER_USER_HELPER]
Firmware Drivers ---> Firmware Drivers --->
[*] Export DMI identification via sysfs to userspace [CONFIG_DMIID] [*] Export DMI identification via sysfs to userspace [CONFIG_DMIID]
EFI (Extensible Firmware Interface) Support --->
[*] Enable the generic EFI decompressor [CONFIG_EFI_ZBOOT]
Graphics support ---> Graphics support --->
Frame buffer Devices ---> Frame buffer Devices --->
<*> Support for frame buffer devices ---> <*> Support for frame buffer devices --->
@ -192,29 +197,6 @@ File systems --->
Pseudo filesystems ---> Pseudo filesystems --->
[*] Tmpfs POSIX Access Control Lists [CONFIG_TMPFS_POSIX_ACL]</screen> [*] Tmpfs POSIX Access Control Lists [CONFIG_TMPFS_POSIX_ACL]</screen>
<para>Enable some additional features if you are building a 64-bit
system. If you are using menuconfig, enable them in the order of
<parameter>CONFIG_PCI_MSI</parameter> first, then
<parameter>CONFIG_IRQ_REMAP</parameter>, at last
<parameter>CONFIG_X86_X2APIC</parameter> because an option only
shows up after its dependencies are selected.</para>
<screen role="nodump">Processor type and features ---&gt;
[*] Support x2apic [CONFIG_X86_X2APIC]
Device Drivers ---&gt;
[*] PCI Support ---&gt; [CONFIG_PCI]
[*] Message Signaled Interrupts (MSI and MSI-X) [CONFIG_PCI_MSI]
[*] IOMMU Hardware Support ---&gt; [CONFIG_IOMMU_SUPPORT]
[*] Support for Interrupt Remapping [CONFIG_IRQ_REMAP]</screen>
<para>If you are building a 32-bit system running on a hardware
with RAM more than 4GB, adjust the configuration so the kernel will
be able to use up to 64GB physical RAM:</para>
<screen role="nodump">Processor type and features ---&gt;
High Memory Support ---&gt;
(X) 64GB [CONFIG_HIGHMEM64G]</screen>
<para>If the partition for the LFS system is in a NVME SSD (i. e. the <para>If the partition for the LFS system is in a NVME SSD (i. e. the
device node for the partition is <filename>/dev/nvme*</filename> device node for the partition is <filename>/dev/nvme*</filename>
instead of <filename>/dev/sd*</filename>), enable NVME support or instead of <filename>/dev/sd*</filename>), enable NVME support or
@ -330,6 +312,15 @@ Device Drivers ---&gt;
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><parameter>Enable the generic EFI decompressor</parameter></term>
<listitem>
<para>Create the bootable image as an EFI application that carries
the actual kernel image in compressed form. It can make the
bootable image 50% smaller.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><parameter>Framebuffer Console support</parameter></term> <term><parameter>Framebuffer Console support</parameter></term>
<listitem> <listitem>
@ -344,18 +335,6 @@ Device Drivers ---&gt;
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><parameter>Support x2apic</parameter></term>
<listitem>
<para>Support running the interrupt controller of 64-bit x86
processors in x2APIC mode. x2APIC may be enabled by firmware on
64-bit x86 systems, and a kernel without this option enabled will
panic on boot if x2APIC is enabled by firmware. This option has
has no effect, but also does no harm if x2APIC is disabled by the
firmware.</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
<para>Alternatively, <command>make oldconfig</command> may be more <para>Alternatively, <command>make oldconfig</command> may be more
@ -410,9 +389,10 @@ Device Drivers ---&gt;
used. The filename below can be changed to suit your taste, but the stem of used. The filename below can be changed to suit your taste, but the stem of
the filename should be <emphasis>vmlinuz</emphasis> to be compatible with the filename should be <emphasis>vmlinuz</emphasis> to be compatible with
the automatic setup of the boot process described in the next section. The the automatic setup of the boot process described in the next section. The
following command assumes an x86 architecture:</para> following command assumes a LoongArch platform with an EFI boot loader
(for example, GRUB built in &ch-final;):</para>
<screen><userinput remap="install">cp -iv arch/x86/boot/bzImage /boot/vmlinuz-&linux-version;-lfs-&version;</userinput></screen> <screen><userinput remap="install">cp -iv arch/loongarch/boot/vmlinuz.efi /boot/vmlinuz-&linux-version;-lfs-&version;</userinput></screen>
<para><filename>System.map</filename> is a symbol file for the kernel. <para><filename>System.map</filename> is a symbol file for the kernel.
It maps the function entry points of every function in the kernel API, It maps the function entry points of every function in the kernel API,