Unverified Commit 50357a03 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4629 add sw64 architecture support

Merge Pull Request from: @guzitao 
 
Add support for sunway architecture platforms: sw3231, sw831 and sw6432.

These patches generally cover the following tasks:
1. add support for perf, acpi, clocksource, cpufreq
2. fix ELF, rrk, acpi, module, kvm, pci, kexec, audit, ftrace, perf, selftests

Test:
All features pass the test.

Related issues:
https://gitee.com/openeuler/kernel/issues/I8Y8CY
https://gitee.com/openeuler/kernel/issues/I8YQTI
https://gitee.com/openeuler/kernel/issues/I56WV8
https://gitee.com/openeuler/kernel/issues/I8YQW8
https://gitee.com/openeuler/kernel/issues/I8YR3H
https://gitee.com/openeuler/kernel/issues/I8YRCP
https://gitee.com/openeuler/kernel/issues/I8YQY2 
 
Link:https://gitee.com/openeuler/kernel/pulls/4629

 

Reviewed-by: default avatarZucheng Zheng <zhengzucheng@huawei.com>
Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 842b5cff d626a13c
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -40,7 +40,8 @@ struct apd_private_data {
	const struct apd_device_desc *dev_desc;
};

#if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || defined(CONFIG_ARM64)
#if defined(CONFIG_X86_AMD_PLATFORM_DEVICE) || \
defined(CONFIG_ARM64) || defined(CONFIG_SW64)
#define APD_ADDR(desc)	((unsigned long)&desc)

static int acpi_apd_setup(struct apd_private_data *pdata)
@@ -178,6 +179,18 @@ static const struct apd_device_desc hip08_spi_desc = {
};
#endif /* CONFIG_ARM64 */

#ifdef CONFIG_SW64
static const struct apd_device_desc sunway_i2c_desc = {
	.setup = acpi_apd_setup,
	.fixed_clk_rate = 25000000,
};

static const struct apd_device_desc sunway_spi_desc = {
	.setup = acpi_apd_setup,
	.fixed_clk_rate = 25000000,
};
#endif

#endif

/*
@@ -246,6 +259,10 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
	{ "HISI02A3", APD_ADDR(hip08_lite_i2c_desc) },
	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
#endif
#ifdef CONFIG_SW64
	{ "HISI02A1", APD_ADDR(sunway_i2c_desc) },
	{ "HISI0173", APD_ADDR(sunway_spi_desc) },
#endif
	{ }
};
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
config ACPI_NUMA
	bool "NUMA support"
	depends on NUMA
	depends on (X86 || IA64 || ARM64 || LOONGARCH)
	depends on (X86 || IA64 || ARM64 || LOONGARCH || SW64)
	default y if IA64 || ARM64

config ACPI_HMAT
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ int __init srat_disabled(void)
	return acpi_numa < 0;
}

#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
#if defined(CONFIG_X86) || defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH) || defined(CONFIG_SW64)
/*
 * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
 * I/O localities since SRAT does not list them.  I/O localities are
+26 −0
Original line number Diff line number Diff line
@@ -186,6 +186,32 @@ static struct mcfg_fixup mcfg_quirks[] = {
	LOONGSON_ECAM_MCFG("\0", 1),
	LOONGSON_ECAM_MCFG("LOONGSON", 1),
#endif /* LOONGARCH */

#ifdef CONFIG_SW64
#define _SW64_ECAM_QUIRK(rev, seg) \
	{ "SUNWAY", "SUNWAY. ", rev, seg, MCFG_BUS_ANY, &sw64_pci_ecam_ops }
#define SW64_ECAM_QUIRK(rev, node)	_SW64_ECAM_QUIRK(rev, node * 8 + 0),\
					_SW64_ECAM_QUIRK(rev, node * 8 + 1),\
					_SW64_ECAM_QUIRK(rev, node * 8 + 2),\
					_SW64_ECAM_QUIRK(rev, node * 8 + 3),\
					_SW64_ECAM_QUIRK(rev, node * 8 + 4),\
					_SW64_ECAM_QUIRK(rev, node * 8 + 5),\
					_SW64_ECAM_QUIRK(rev, node * 8 + 6),\
					_SW64_ECAM_QUIRK(rev, node * 8 + 7)

	/**
	 * According to the address space of sw64, up to 8 nodes supported
	 * with a maximum of 8 pcie controllers per node
	 */
	SW64_ECAM_QUIRK(1, 0x00),
	SW64_ECAM_QUIRK(1, 0x01),
	SW64_ECAM_QUIRK(1, 0x02),
	SW64_ECAM_QUIRK(1, 0x03),
	SW64_ECAM_QUIRK(1, 0x04),
	SW64_ECAM_QUIRK(1, 0x05),
	SW64_ECAM_QUIRK(1, 0x06),
	SW64_ECAM_QUIRK(1, 0x07),
#endif /* SW64 */
};

static char mcfg_oem_id[ACPI_OEM_ID_SIZE];
+3 −0
Original line number Diff line number Diff line
@@ -737,4 +737,7 @@ config ARM_ARCH_TIMER_WORKAROUND_IN_USERSPACE
	default y
	depends on ARM_ARCH_TIMER_OOL_WORKAROUND

config SW64_TIMER
	bool

endmenu
Loading