• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18 #include <linux/module.h>
19 #include <linux/kernel.h>
20 #include <linux/printk.h>
21 #include <linux/version.h>
22 #include <linux/of_platform.h>
23 
24 #include "hi_common.h"
25 #include "hi_osal.h"
26 
27 
28 extern int sys_do_mod_init(void);
29 extern void sys_do_mod_exit(void);
30 
31 extern void  *g_reg_crg_base_va;
32 EXPORT_SYMBOL(g_reg_crg_base_va);
33 #ifndef CONFIG_USER_SPACE
34 extern void  *g_reg_sys_base_va;
35 EXPORT_SYMBOL(g_reg_sys_base_va);
36 extern void  *g_reg_ddr0_base_va;
37 EXPORT_SYMBOL(g_reg_ddr0_base_va);
38 extern void  *g_reg_misc_base_va;
39 EXPORT_SYMBOL(g_reg_misc_base_va);
40 extern void  *g_reg_otp_base_va;
41 EXPORT_SYMBOL(g_reg_otp_base_va);
42 #endif
43 
hi35xx_sys_probe(struct platform_device * pdev)44 static int hi35xx_sys_probe(struct platform_device *pdev)
45 {
46     hi_unused(pdev);
47 
48     if (sys_do_mod_init() != HI_SUCCESS) {
49         return HI_FAILURE;
50     }
51     return 0;
52 }
53 
hi35xx_sys_remove(struct platform_device * pdev)54 static int hi35xx_sys_remove(struct platform_device *pdev)
55 {
56     hi_unused(pdev);
57 
58     sys_do_mod_exit();
59     return 0;
60 }
61 
62 static const struct of_device_id hi35xx_sys_match[] = {
63     { .compatible = "hisilicon,hisi-sys" },
64     {},
65 };
66 MODULE_DEVICE_TABLE(of, hi35xx_sys_match);
67 
68 static struct platform_driver hi35xx_sys_driver = {
69     .probe = hi35xx_sys_probe,
70     .remove = hi35xx_sys_remove,
71     .driver = {
72         .name = "hi35xx_sys",
73         .of_match_table = hi35xx_sys_match,
74     },
75 };
76 
77 osal_module_platform_driver(hi35xx_sys_driver);
78 
79 MODULE_LICENSE("GPL");
80