soc: Remove copyright notices
[coreboot.git] / src / soc / qualcomm / ipq40xx / soc.c
blob742a8ef38a42a39f340e7c9c6fb598f9342576e2
1 /*
2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
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.
15 #include <console/console.h>
16 #include <device/device.h>
17 #include <symbols.h>
18 #include <soc/ipq_uart.h>
20 typedef struct {
21 uint8_t hlos1[112 * MiB], /* <-- 0x80000000 */
22 appsbl[4 * MiB], /* <-- 0x87000000 */
23 sbl[1 * MiB], /* <-- 0x87400000 */
24 rsvd[11 * MiB], /* <-- 0x87500000 */
25 hlos2[128 * MiB]; /* <-- 0x88000000 */
26 } ipq_mem_map_t;
28 #define LINUX_REGION1_START ((uintptr_t)(ipq_mem_map->hlos1))
29 #define LINUX_REGION1_START_KB (LINUX_REGION1_START / KiB)
30 #define LINUX_REGION1_SIZE (sizeof(ipq_mem_map->hlos1) + \
31 sizeof(ipq_mem_map->appsbl) + \
32 sizeof(ipq_mem_map->sbl))
33 #define LINUX_REGION1_SIZE_KB (LINUX_REGION1_SIZE / KiB)
35 #define RESERVED_START ((uintptr_t)(ipq_mem_map->rsvd))
36 #define RESERVED_START_KB (RESERVED_START / KiB)
37 #define RESERVED_SIZE (sizeof(ipq_mem_map->rsvd))
38 #define RESERVED_SIZE_KB (RESERVED_SIZE / KiB)
40 /* xxx_SIZE defines not needed since it goes till end of memory */
41 #define LINUX_REGION2_START ((uintptr_t)(ipq_mem_map->hlos2))
42 #define LINUX_REGION2_START_KB (LINUX_REGION2_START / KiB)
44 static void soc_read_resources(struct device *dev)
46 ipq_mem_map_t *ipq_mem_map = ((ipq_mem_map_t *)_dram);
48 ram_resource(dev, 0, LINUX_REGION1_START_KB, LINUX_REGION1_SIZE_KB);
50 reserved_ram_resource(dev, 1, RESERVED_START_KB, RESERVED_SIZE_KB);
52 /* 0x88000000 to end, is the second region for Linux */
53 ram_resource(dev, 2, LINUX_REGION2_START_KB,
54 (CONFIG_DRAM_SIZE_MB * KiB) -
55 LINUX_REGION1_SIZE_KB - RESERVED_SIZE_KB);
58 static void soc_init(struct device *dev)
61 * Do this in case console is not enabled: kernel's earlyprintk()
62 * should work no matter what the firmware console configuration is.
64 ipq40xx_uart_init();
66 printk(BIOS_INFO, "CPU: QCA 40xx\n");
69 static struct device_operations soc_ops = {
70 .read_resources = soc_read_resources,
71 .init = soc_init,
74 static void enable_soc_dev(struct device *dev)
76 dev->ops = &soc_ops;
79 struct chip_operations soc_qualcomm_ipq40xx_ops = {
80 CHIP_NAME("SOC QCA 40xx")
81 .enable_dev = enable_soc_dev,