Commit 7b2afeaf authored by Huacai Chen's avatar Huacai Chen
Browse files

LoongArch: Adjust boot & setup for 32BIT/64BIT



Adjust boot & setup for both 32BIT and 64BIT, including: efi header
definition, MAX_IO_PICS definition, kernel entry and environment setup
routines, etc.

Add a fallback path in fdt_cpu_clk_init() to avoid 0MHz in /proc/cpuinfo
if there is no valid clock freq from firmware.

Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent 708ed32c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ extern unsigned long vm_map_base;
#endif

#define DMW_PABITS	48
#define TO_PHYS_MASK	((1ULL << DMW_PABITS) - 1)
#define TO_PHYS_MASK	((_ULL(1) << _ULL(DMW_PABITS)) - 1)

/*
 * Memory above this physical address will be considered highmem.
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
#define dmi_early_unmap(x, l)	dmi_unmap(x)
#define dmi_alloc(l)		memblock_alloc(l, PAGE_SIZE)

static inline void *dmi_remap(u64 phys_addr, unsigned long size)
static inline void *dmi_remap(phys_addr_t phys_addr, unsigned long size)
{
	return ((void *)TO_CACHE(phys_addr));
}
+5 −0
Original line number Diff line number Diff line
@@ -60,7 +60,12 @@ void spurious_interrupt(void);
#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
void arch_trigger_cpumask_backtrace(const struct cpumask *mask, int exclude_cpu);

#ifdef CONFIG_32BIT
#define MAX_IO_PICS 1
#else
#define MAX_IO_PICS 8
#endif

#define NR_IRQS	(64 + NR_VECTORS * (NR_CPUS + MAX_IO_PICS))

struct acpi_vector_group {
+4 −0
Original line number Diff line number Diff line
@@ -9,7 +9,11 @@
	.macro	__EFI_PE_HEADER
	.long	IMAGE_NT_SIGNATURE
.Lcoff_header:
#ifdef CONFIG_32BIT
	.short	IMAGE_FILE_MACHINE_LOONGARCH32		/* Machine */
#else
	.short	IMAGE_FILE_MACHINE_LOONGARCH64		/* Machine */
#endif
	.short	.Lsection_count				/* NumberOfSections */
	.long	0 					/* TimeDateStamp */
	.long	0					/* PointerToSymbolTable */
+3 −1
Original line number Diff line number Diff line
@@ -115,7 +115,9 @@ void __init efi_init(void)

	efi_systab_report_header(&efi_systab->hdr, efi_systab->fw_vendor);

	if (IS_ENABLED(CONFIG_64BIT))
		set_bit(EFI_64BIT, &efi.flags);

	efi_nr_tables	 = efi_systab->nr_tables;
	efi_config_table = (unsigned long)efi_systab->tables;

Loading