blob: 77c968bd179588b5a19e8b7e180dbd2bc468de4d [file] [log] [blame]
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -07001/*
2 * This file is part of the coreboot project.
3 *
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -07004 *
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.
8 *
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.
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -070013 */
14
15#include <console/console.h>
16#include <device/device.h>
Julius Wernerec5e5e02014-08-20 15:29:56 -070017#include <symbols.h>
Vadim Bendebury7c256402015-01-13 13:07:48 -080018#include <soc/ipq_uart.h>
David Hendricks24452742014-07-02 13:50:57 -070019
20#define RESERVED_SIZE_KB (0x01500000 / KiB)
21
Elyes HAOUASd6cd2552018-05-25 10:01:13 +020022static void soc_read_resources(struct device *dev)
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -070023{
David Hendricks24452742014-07-02 13:50:57 -070024 /* Reserve bottom 0x150_0000 bytes for NSS, SMEM, etc. */
Julius Wernerec5e5e02014-08-20 15:29:56 -070025 reserved_ram_resource(dev, 0, (uintptr_t)_dram / KiB, RESERVED_SIZE_KB);
26 ram_resource(dev, 0, (uintptr_t)_dram / KiB + RESERVED_SIZE_KB,
David Hendricks24452742014-07-02 13:50:57 -070027 (CONFIG_DRAM_SIZE_MB * KiB) - RESERVED_SIZE_KB);
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -070028}
29
Elyes HAOUASd6cd2552018-05-25 10:01:13 +020030static void soc_init(struct device *dev)
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -070031{
Vadim Bendebury7c256402015-01-13 13:07:48 -080032 /*
33 * Do this in case console is not enabled: kernel's earlyprintk()
34 * should work no matter what the firmware console configuration is.
35 */
36 ipq806x_uart_init();
37
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -070038 printk(BIOS_INFO, "CPU: Qualcomm 8064\n");
39}
40
41static struct device_operations soc_ops = {
42 .read_resources = soc_read_resources,
43 .init = soc_init,
44};
45
Elyes HAOUASd6cd2552018-05-25 10:01:13 +020046static void enable_soc_dev(struct device *dev)
Vadim Bendebury41a5d0d2014-05-13 17:47:57 -070047{
48 dev->ops = &soc_ops;
49}
50
51struct chip_operations soc_qualcomm_ipq806x_ops = {
52 CHIP_NAME("SOC Qualcomm 8064")
53 .enable_dev = enable_soc_dev,
54};