Vadim Bendebury | 41a5d0d | 2014-05-13 17:47:57 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2007-2009 coresystems GmbH |
| 5 | * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. |
| 6 | * Copyright 2013 Google Inc. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; version 2 of the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
Vadim Bendebury | 41a5d0d | 2014-05-13 17:47:57 -0700 | [diff] [blame] | 16 | */ |
| 17 | |
| 18 | #include <console/console.h> |
| 19 | #include <device/device.h> |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 20 | #include <symbols.h> |
Vadim Bendebury | 7c25640 | 2015-01-13 13:07:48 -0800 | [diff] [blame] | 21 | #include <soc/ipq_uart.h> |
David Hendricks | 2445274 | 2014-07-02 13:50:57 -0700 | [diff] [blame] | 22 | |
| 23 | #define RESERVED_SIZE_KB (0x01500000 / KiB) |
| 24 | |
Vadim Bendebury | 41a5d0d | 2014-05-13 17:47:57 -0700 | [diff] [blame] | 25 | static void soc_read_resources(device_t dev) |
| 26 | { |
David Hendricks | 2445274 | 2014-07-02 13:50:57 -0700 | [diff] [blame] | 27 | /* Reserve bottom 0x150_0000 bytes for NSS, SMEM, etc. */ |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 28 | reserved_ram_resource(dev, 0, (uintptr_t)_dram / KiB, RESERVED_SIZE_KB); |
| 29 | ram_resource(dev, 0, (uintptr_t)_dram / KiB + RESERVED_SIZE_KB, |
David Hendricks | 2445274 | 2014-07-02 13:50:57 -0700 | [diff] [blame] | 30 | (CONFIG_DRAM_SIZE_MB * KiB) - RESERVED_SIZE_KB); |
Vadim Bendebury | 41a5d0d | 2014-05-13 17:47:57 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | static void soc_init(device_t dev) |
| 34 | { |
Vadim Bendebury | 7c25640 | 2015-01-13 13:07:48 -0800 | [diff] [blame] | 35 | /* |
| 36 | * Do this in case console is not enabled: kernel's earlyprintk() |
| 37 | * should work no matter what the firmware console configuration is. |
| 38 | */ |
| 39 | ipq806x_uart_init(); |
| 40 | |
Vadim Bendebury | 41a5d0d | 2014-05-13 17:47:57 -0700 | [diff] [blame] | 41 | printk(BIOS_INFO, "CPU: Qualcomm 8064\n"); |
| 42 | } |
| 43 | |
| 44 | static struct device_operations soc_ops = { |
| 45 | .read_resources = soc_read_resources, |
| 46 | .init = soc_init, |
| 47 | }; |
| 48 | |
| 49 | static void enable_soc_dev(device_t dev) |
| 50 | { |
| 51 | dev->ops = &soc_ops; |
| 52 | } |
| 53 | |
| 54 | struct chip_operations soc_qualcomm_ipq806x_ops = { |
| 55 | CHIP_NAME("SOC Qualcomm 8064") |
| 56 | .enable_dev = enable_soc_dev, |
| 57 | }; |