David Hendricks | 8cbd569 | 2017-12-01 20:49:48 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright 2018-present Facebook, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #include <types.h> |
| 17 | #include <arch/io.h> |
| 18 | #include <soc/cpu.h> |
| 19 | #include <bdk-coreboot.h> |
| 20 | |
| 21 | /* Return the number of cores available in the chip */ |
| 22 | size_t cpu_get_num_cores(void) |
| 23 | { |
| 24 | uint64_t available = read64((void *)0x87e006001738ll); |
| 25 | return bdk_dpop(available); |
| 26 | } |