diff options
author | David Hendricks <dhendricks@fb.com> | 2018-03-09 14:30:38 -0800 |
---|---|---|
committer | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2018-07-03 15:53:32 +0000 |
commit | 7d48ac5c7dfb52fc470bbad1013b4d460bc6a1e0 (patch) | |
tree | 42002ba1e86627339ff4a6cf38efb4b3f00033bb /src/vendorcode/cavium/include/bdk/bdk-minimal.h | |
parent | d837e660074e0621d63f59515f933c209441b653 (diff) | |
download | coreboot-7d48ac5c7dfb52fc470bbad1013b4d460bc6a1e0.tar.xz |
soc/cavium: Integrate BDK files into coreboot
* Make it compile.
* Fix whitespace errors.
* Fix printf formats.
* Add missing headers includes
* Guard headers with ifdefs
Compile DRAM init code in romstage.
Compile QLM, PCIe, RNG, PHY, GPIO, MDIO init code in ramstage.
Change-Id: I0a93219a14bfb6ebe41103a825d5032b11e7f2c6
Signed-off-by: David Hendricks <dhendricks@fb.com>
Reviewed-on: https://review.coreboot.org/25089
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/vendorcode/cavium/include/bdk/bdk-minimal.h')
-rw-r--r-- | src/vendorcode/cavium/include/bdk/bdk-minimal.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/vendorcode/cavium/include/bdk/bdk-minimal.h b/src/vendorcode/cavium/include/bdk/bdk-minimal.h new file mode 100644 index 0000000000..3ecf5a700a --- /dev/null +++ b/src/vendorcode/cavium/include/bdk/bdk-minimal.h @@ -0,0 +1,60 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (c) 2003-2017 Cavium Inc. (support@cavium.com). All rights + * reserved. + * Copyright 2017-present Facebook, Inc. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * bdk-minimal.h: Subset of bdk.h used by coreboot + */ + +#ifndef __SOC_CAVIUM_COMMON_BDK_MINIMAL_H__ +#define __SOC_CAVIUM_COMMON_BDK_MINIMAL_H__ + +#include <console/console.h> /* for printk */ +#include <endian.h> +#include <stddef.h> /* for NULL */ +#include <libbdk-hal/bdk-access.h> + +#define bdk_le16_to_cpu(x) le16_to_cpu(x) +#define bdk_le32_to_cpu(x) le32_to_cpu(x) +#define bdk_le64_to_cpu(x) le64_to_cpu(x) +#define bdk_be16_to_cpu(x) be16_to_cpu(x) +#define bdk_be32_to_cpu(x) be32_to_cpu(x) +#define bdk_be64_to_cpu(x) be64_to_cpu(x) +#define bdk_cpu_to_le16(x) cpu_to_le16(x) +#define bdk_cpu_to_le32(x) cpu_to_le32(x) +#define bdk_cpu_to_le64(x) cpu_to_le64(x) + +#define __BYTE_ORDER __BYTE_ORDER__ +/* Watch out for __BIG_ENDIAN. coreboot usually checks if it's defined at all + * but the Cavium BDK checks its value. */ +#define __BIG_ENDIAN 4321 + +#define printf(format, ...) printk(BIOS_DEBUG, format, ##__VA_ARGS__) +#define puts(str) printk(BIOS_INFO, str) +#define fflush(x) /* output gets flushed automatically */ + +/* careful, the ordering matters for some headers */ +#include <libbdk-arch/bdk-warn.h> +#include <libbdk-arch/bdk-asm.h> +#include <libbdk-arch/bdk-model.h> +#include <libbdk-arch/bdk-numa.h> + +#include <libbdk-arch/bdk-require.h> +#include <libbdk-arch/bdk-csr.h> + +#include <libbdk-os/bdk-thread.h> + +/* FIXME: experiment to see if including the universe here will solve some + * current build issues... */ +#include <libbdk-arch/bdk-arch.h> +#include <libbdk-boot/bdk-boot.h> +#include <libbdk-dram/bdk-dram.h> +#include <libdram/libdram.h> + +static inline char *getenv(const char *name) { return NULL; } + +#endif /* !__SOC_CAVIUM_COMMON_BDK_MINIMAL_H__ */ |