Angel Pons | 585495e | 2020-04-03 01:21:38 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 3 | |
| 4 | #include <console/console.h> |
| 5 | #include <device/device.h> |
| 6 | #include <cbmem.h> |
| 7 | |
Elyes HAOUAS | 5cb876c | 2018-06-08 18:31:43 +0200 | [diff] [blame] | 8 | static void mainboard_enable(struct device *dev) |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 9 | { |
Jonathan Neuschäfer | c98aac0 | 2016-07-07 20:53:29 +0200 | [diff] [blame] | 10 | /* |
| 11 | * Size of the emulated system RAM. On hardware, this would be external |
| 12 | * DDR memory. |
| 13 | * |
| 14 | * TODO: Get this size from the hardware-supplied configuration string. |
| 15 | */ |
| 16 | const size_t ram_size = 1*GiB; |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 17 | |
| 18 | if (!dev) { |
Jonathan Neuschäfer | 2af174a | 2016-10-12 00:18:00 +0200 | [diff] [blame] | 19 | die("No dev0; die\n"); |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 20 | } |
| 21 | |
Jonathan Neuschäfer | c98aac0 | 2016-07-07 20:53:29 +0200 | [diff] [blame] | 22 | ram_resource(dev, 0, 0x80000000/KiB, ram_size/KiB); |
| 23 | |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 24 | cbmem_recovery(0); |
| 25 | } |
| 26 | |
| 27 | struct chip_operations mainboard_ops = { |
| 28 | .enable_dev = mainboard_enable, |
| 29 | }; |