提交 ef543d3f 编写于 作者: D Ding Tianhong 提交者: Yang Yingliang

arm64/ascend: enable ascend features for Ascend910 platform

ascend inclusion
category: feature
bugzilla: NA
CVE: NA

-------------------------------------------------

The Ascend910 platform only use the acpi mode to boot system,
the oem message is recorded in the oem_table_id of IORT table,
so use the oem message to enable the ascend features.
Signed-off-by: NDing Tianhong <dingtianhong@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ecec54f4
...@@ -769,7 +769,7 @@ __setup("keepinitrd", keepinitrd_setup); ...@@ -769,7 +769,7 @@ __setup("keepinitrd", keepinitrd_setup);
#endif #endif
#ifdef CONFIG_ASCEND_FEATURES #ifdef CONFIG_ASCEND_FEATURES
static int __init ascend_enable_setup(char *__unused) void ascend_enable_all_features(void)
{ {
if (IS_ENABLED(CONFIG_ASCEND_DVPP_MMAP)) if (IS_ENABLED(CONFIG_ASCEND_DVPP_MMAP))
enable_mmap_dvpp = 1; enable_mmap_dvpp = 1;
...@@ -782,6 +782,11 @@ static int __init ascend_enable_setup(char *__unused) ...@@ -782,6 +782,11 @@ static int __init ascend_enable_setup(char *__unused)
if (IS_ENABLED(CONFIG_SUSPEND)) if (IS_ENABLED(CONFIG_SUSPEND))
mem_sleep_current = PM_SUSPEND_ON; mem_sleep_current = PM_SUSPEND_ON;
}
static int __init ascend_enable_setup(char *__unused)
{
ascend_enable_all_features();
return 1; return 1;
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/init.h>
#define IORT_TYPE_MASK(type) (1 << (type)) #define IORT_TYPE_MASK(type) (1 << (type))
#define IORT_MSI_TYPE (1 << ACPI_IORT_NODE_ITS_GROUP) #define IORT_MSI_TYPE (1 << ACPI_IORT_NODE_ITS_GROUP)
...@@ -1639,6 +1640,26 @@ static void __init iort_init_platform_devices(void) ...@@ -1639,6 +1640,26 @@ static void __init iort_init_platform_devices(void)
} }
} }
/*
* This function detects the ascend platform by oem table id.
*/
static bool ascend_platform_detected(struct acpi_table_header *h)
{
if (!memcmp(h->oem_table_id, "HI19801P", ACPI_OEM_TABLE_ID_SIZE))
return true;
if (!memcmp(h->oem_table_id, "HI19802P", ACPI_OEM_TABLE_ID_SIZE))
return true;
if (!memcmp(h->oem_table_id, "HI19804P", ACPI_OEM_TABLE_ID_SIZE))
return true;
if (!memcmp(h->oem_table_id, "HI1980\0\0", ACPI_OEM_TABLE_ID_SIZE))
return true;
return false;
}
void __init acpi_iort_init(void) void __init acpi_iort_init(void)
{ {
acpi_status status; acpi_status status;
...@@ -1654,5 +1675,8 @@ void __init acpi_iort_init(void) ...@@ -1654,5 +1675,8 @@ void __init acpi_iort_init(void)
return; return;
} }
if (ascend_platform_detected(iort_table))
ascend_enable_all_features();
iort_init_platform_devices(); iort_init_platform_devices();
} }
...@@ -306,4 +306,11 @@ void __init parse_early_options(char *cmdline); ...@@ -306,4 +306,11 @@ void __init parse_early_options(char *cmdline);
#define __exit_p(x) NULL #define __exit_p(x) NULL
#endif #endif
#ifndef __ASSEMBLY__
#ifdef CONFIG_ASCEND_FEATURES
extern void ascend_enable_all_features(void);
#else
static inline void ascend_enable_all_features(void) { }
#endif
#endif
#endif /* _LINUX_INIT_H */ #endif /* _LINUX_INIT_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册