| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <symbols.h> |
| 6 |
#include <soc/ipq_uart.h> |
| 7 |
|
| 8 |
|
| 9 |
typedef struct { |
| 10 |
uint8_t hlos1[112 * MiB], |
| 11 |
appsbl[4 * MiB], |
| 12 |
sbl[1 * MiB], |
| 13 |
rsvd[11 * MiB], |
| 14 |
hlos2[128 * MiB]; |
| 15 |
} ipq_mem_map_t; |
| 16 |
|
| 17 |
static void soc_read_resources(struct device *dev) |
| 18 |
{ |
| 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; |
| 21 |
|
| 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); |
| 25 |
|
| 26 |
|
| 27 |
ram_from_to(dev, 2, (uintptr_t)ipq_mem_map->hlos2, ram_end); |
| 28 |
} |
| 29 |
|
| 30 |
static void soc_init(struct device *dev) |
| 31 |
{ |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
ipq40xx_uart_init(); |
| 37 |
|
| 38 |
printk(BIOS_INFO, "CPU: QCA 40xx\n"); |
| 39 |
} |
| 40 |
|
| 41 |
static struct device_operations soc_ops = { |
| 42 |
.read_resources = soc_read_resources, |
| 43 |
.init = soc_init, |
| 44 |
}; |
| 45 |
|
| 46 |
static void enable_soc_dev(struct device *dev) |
| 47 |
{ |
| 48 |
dev->ops = &soc_ops; |
| 49 |
} |
| 50 |
|
| 51 |
struct chip_operations soc_qualcomm_ipq40xx_ops = { |
| 52 |
.name = "SOC QCA 40xx", |
| 53 |
.enable_dev = enable_soc_dev, |
| 54 |
}; |