1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <device/device.h>
6 #include <soc/ipq_uart.h>
8 /* CONFIG_DRAM_SIZE_MB effectively extends hlos2. */
10 uint8_t hlos1
[112 * MiB
], /* <-- 0x80000000 */
11 appsbl
[4 * MiB
], /* <-- 0x87000000 */
12 sbl
[1 * MiB
], /* <-- 0x87400000 */
13 rsvd
[11 * MiB
], /* <-- 0x87500000 */
14 hlos2
[128 * MiB
]; /* <-- 0x88000000 */
17 static void soc_read_resources(struct device
*dev
)
19 ipq_mem_map_t
*ipq_mem_map
= ((ipq_mem_map_t
*)_dram
);
20 uint64_t ram_end
= (uintptr_t)_dram
+ CONFIG_DRAM_SIZE_MB
* (uint64_t)MiB
;
22 ram_from_to(dev
, 0, (uintptr_t)ipq_mem_map
->hlos1
, (uintptr_t)ipq_mem_map
->rsvd
);
23 reserved_ram_from_to(dev
, 1, (uintptr_t)ipq_mem_map
->rsvd
,
24 (uintptr_t)ipq_mem_map
->hlos2
);
26 /* 0x88000000 to end, is the second region for Linux */
27 ram_from_to(dev
, 2, (uintptr_t)ipq_mem_map
->hlos2
, ram_end
);
30 static void soc_init(struct device
*dev
)
33 * Do this in case console is not enabled: kernel's earlyprintk()
34 * should work no matter what the firmware console configuration is.
38 printk(BIOS_INFO
, "CPU: QCA 40xx\n");
41 static struct device_operations soc_ops
= {
42 .read_resources
= soc_read_resources
,
46 static void enable_soc_dev(struct device
*dev
)
51 struct chip_operations soc_qualcomm_ipq40xx_ops
= {
52 .name
= "SOC QCA 40xx",
53 .enable_dev
= enable_soc_dev
,