blob: c054aa89872f4b3183fc12e4a73c117f754f8507 [file] [log] [blame]
David Hendricks8cbd5692017-12-01 20:49:48 -08001/*
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 */
22size_t cpu_get_num_cores(void)
23{
24 uint64_t available = read64((void *)0x87e006001738ll);
25 return bdk_dpop(available);
26}