.. | .. |
---|
9 | 9 | |
---|
10 | 10 | #include <linux/init.h> |
---|
11 | 11 | #include <linux/bitops.h> |
---|
12 | | -#include <linux/bootmem.h> |
---|
13 | | -#include <linux/clk-provider.h> |
---|
| 12 | +#include <linux/memblock.h> |
---|
14 | 13 | #include <linux/ioport.h> |
---|
15 | 14 | #include <linux/kernel.h> |
---|
16 | 15 | #include <linux/io.h> |
---|
17 | 16 | #include <linux/of.h> |
---|
| 17 | +#include <linux/of_clk.h> |
---|
18 | 18 | #include <linux/of_fdt.h> |
---|
19 | 19 | #include <linux/of_platform.h> |
---|
20 | 20 | #include <linux/libfdt.h> |
---|
.. | .. |
---|
33 | 33 | |
---|
34 | 34 | #define REG_BCM6328_OTP ((void __iomem *)CKSEG1ADDR(0x1000062c)) |
---|
35 | 35 | #define BCM6328_TP1_DISABLED BIT(9) |
---|
| 36 | + |
---|
| 37 | +extern bool bmips_rac_flush_disable; |
---|
36 | 38 | |
---|
37 | 39 | static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000; |
---|
38 | 40 | |
---|
.. | .. |
---|
103 | 105 | * disable SMP for now |
---|
104 | 106 | */ |
---|
105 | 107 | bmips_smp_enabled = 0; |
---|
| 108 | + |
---|
| 109 | + /* |
---|
| 110 | + * RAC flush causes kernel panics on BCM6358 when booting from TP1 |
---|
| 111 | + * because the bootloader is not initializing it properly. |
---|
| 112 | + */ |
---|
| 113 | + bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)); |
---|
106 | 114 | } |
---|
107 | 115 | |
---|
108 | 116 | static void bcm6368_quirks(void) |
---|
.. | .. |
---|
153 | 161 | mips_hpt_frequency = freq; |
---|
154 | 162 | } |
---|
155 | 163 | |
---|
156 | | -extern const char __appended_dtb; |
---|
157 | | - |
---|
158 | 164 | void __init plat_mem_setup(void) |
---|
159 | 165 | { |
---|
160 | 166 | void *dtb; |
---|
.. | .. |
---|
164 | 170 | ioport_resource.start = 0; |
---|
165 | 171 | ioport_resource.end = ~0; |
---|
166 | 172 | |
---|
167 | | -#ifdef CONFIG_MIPS_ELF_APPENDED_DTB |
---|
168 | | - if (!fdt_check_header(&__appended_dtb)) |
---|
169 | | - dtb = (void *)&__appended_dtb; |
---|
170 | | - else |
---|
171 | | -#endif |
---|
172 | | - /* intended to somewhat resemble ARM; see Documentation/arm/Booting */ |
---|
| 173 | + /* intended to somewhat resemble ARM; see Documentation/arm/booting.rst */ |
---|
173 | 174 | if (fw_arg0 == 0 && fw_arg1 == 0xffffffff) |
---|
174 | 175 | dtb = phys_to_virt(fw_arg2); |
---|
175 | | - else if (fw_passed_dtb) /* UHI interface */ |
---|
| 176 | + else if (fw_passed_dtb) /* UHI interface or appended dtb */ |
---|
176 | 177 | dtb = (void *)fw_passed_dtb; |
---|
177 | | - else if (__dtb_start != __dtb_end) |
---|
| 178 | + else if (&__dtb_start != &__dtb_end) |
---|
178 | 179 | dtb = (void *)__dtb_start; |
---|
179 | 180 | else |
---|
180 | 181 | panic("no dtb found"); |
---|