File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed
include/asm/mach-loongson64 Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0-or-later */
2
+ /*
3
+ * Copyright (C) 2019 Jiaxun Yang <[email protected] >
4
+ *
5
+ * Built-in Generic dtbs for MACH_LOONGSON64
6
+ */
7
+
8
+ #ifndef __ASM_MACH_LOONGSON64_BUILTIN_DTBS_H_
9
+ #define __ASM_MACH_LOONGSON64_BUILTIN_DTBS_H_
10
+
11
+ extern u32 __dtb_loongson3_4core_rs780e_begin [];
12
+ extern u32 __dtb_loongson3_8core_rs780e_begin [];
13
+ #endif
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ extern const struct plat_smp_ops loongson3_smp_ops;
25
25
/* loongson-specific command line, env and memory initialization */
26
26
extern void __init prom_init_memory (void );
27
27
extern void __init prom_init_env (void );
28
+ extern void * loongson_fdt_blob ;
28
29
29
30
/* irq operation functions */
30
31
extern void mach_irq_dispatch (unsigned int pending );
Original file line number Diff line number Diff line change 17
17
#include <asm/bootinfo.h>
18
18
#include <loongson.h>
19
19
#include <boot_param.h>
20
+ #include <builtin_dtbs.h>
20
21
#include <workarounds.h>
21
22
22
23
u32 cpu_clock_freq ;
@@ -120,6 +121,28 @@ void __init prom_init_env(void)
120
121
loongson_sysconf .cores_per_node - 1 ) /
121
122
loongson_sysconf .cores_per_node ;
122
123
124
+ if ((read_c0_prid () & PRID_IMP_MASK ) == PRID_IMP_LOONGSON_64C ) {
125
+ switch (read_c0_prid () & PRID_REV_MASK ) {
126
+ case PRID_REV_LOONGSON3A_R1 :
127
+ case PRID_REV_LOONGSON3A_R2_0 :
128
+ case PRID_REV_LOONGSON3A_R2_1 :
129
+ case PRID_REV_LOONGSON3A_R3_0 :
130
+ case PRID_REV_LOONGSON3A_R3_1 :
131
+ loongson_fdt_blob = __dtb_loongson3_4core_rs780e_begin ;
132
+ break ;
133
+ case PRID_REV_LOONGSON3B_R1 :
134
+ case PRID_REV_LOONGSON3B_R2 :
135
+ loongson_fdt_blob = __dtb_loongson3_8core_rs780e_begin ;
136
+ break ;
137
+ default :
138
+ break ;
139
+ }
140
+ }
141
+
142
+
143
+ if (!loongson_fdt_blob )
144
+ pr_err ("Failed to determine built-in Loongson64 dtb\n" );
145
+
123
146
loongson_sysconf .pci_mem_start_addr = eirq_source -> pci_mem_start_addr ;
124
147
loongson_sysconf .pci_mem_end_addr = eirq_source -> pci_mem_end_addr ;
125
148
loongson_sysconf .pci_io_base = eirq_source -> pci_io_start_addr ;
Original file line number Diff line number Diff line change 8
8
9
9
#include <asm/wbflush.h>
10
10
#include <asm/bootinfo.h>
11
+ #include <linux/libfdt.h>
12
+ #include <linux/of_fdt.h>
13
+
14
+ #include <asm/prom.h>
11
15
12
16
#include <loongson.h>
13
17
18
+ void * loongson_fdt_blob ;
19
+
14
20
static void wbflush_loongson (void )
15
21
{
16
22
asm(".set\tpush\n\t"
@@ -27,4 +33,14 @@ EXPORT_SYMBOL(__wbflush);
27
33
28
34
void __init plat_mem_setup (void )
29
35
{
36
+ if (loongson_fdt_blob )
37
+ __dt_setup_arch (loongson_fdt_blob );
38
+ }
39
+
40
+ void __init device_tree_init (void )
41
+ {
42
+ if (!initial_boot_params )
43
+ return ;
44
+
45
+ unflatten_and_copy_device_tree ();
30
46
}
You can’t perform that action at this time.
0 commit comments