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/libbdk-os | |
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/libbdk-os')
-rw-r--r-- | src/vendorcode/cavium/include/bdk/libbdk-os/bdk-init.h | 110 | ||||
-rw-r--r-- | src/vendorcode/cavium/include/bdk/libbdk-os/bdk-thread.h | 3 |
2 files changed, 9 insertions, 104 deletions
diff --git a/src/vendorcode/cavium/include/bdk/libbdk-os/bdk-init.h b/src/vendorcode/cavium/include/bdk/libbdk-os/bdk-init.h index 834f8970f1..c3563eabd3 100644 --- a/src/vendorcode/cavium/include/bdk/libbdk-os/bdk-init.h +++ b/src/vendorcode/cavium/include/bdk/libbdk-os/bdk-init.h @@ -1,3 +1,5 @@ +#ifndef __CB_BDK_INIT_H__ +#define __CB_BDK_INIT_H__ /***********************license start*********************************** * Copyright (c) 2003-2017 Cavium Inc. (support@cavium.com). All rights * reserved. @@ -71,98 +73,6 @@ extern int bdk_init_cores(bdk_node_t node, uint64_t coremask); extern int bdk_reset_cores(bdk_node_t node, uint64_t coremask); /** - * Call this function to take secondary nodes and cores out of - * reset and have them start running threads - * - * @param skip_cores If non-zero, cores are not started. Only the nodes are setup - * @param ccpi_sw_gbaud - * If CCPI is in software mode, this is the speed the CCPI QLMs will be configured - * for - * - * @return Zero on success, negative on failure. - */ -extern int bdk_init_nodes(int skip_cores, int ccpi_sw_gbaud); - -/** - * Called very early in during init of both the master and slave. It performs one - * time init of CCPI QLM and link parameters. It must only be called once per - * boot. - * - * @param is_master Non-zero if the caller is the master node - */ -extern void __bdk_init_ccpi_early(int is_master); - -/** - * Brings the CCPI lanes and links into an operational state without perofrming - * node discovery and enumeration. After this function succeeds, CCPI lanes and - * links are ready for traffic, but node routing has not been setup. - * - * Note this function runs on the slave node with the BDK code not at its link - * address. Many normal BDK functions do not work properly. Be careful. - * - * @param is_master Non-zero when run on the master node. Zero when run on the slave - * @param gbaud Baud rate to run links at. This is only used if the QLMs are in software init - * mode. If they are strapped for hardware init, the strapping speed is used. - * @param ccpi_trace Non-zero to enable CCPI tracing. Note that tracing doesn't use the standard - * bdk-trace functions. This code runs on the secondary node before we are - * multi-node, and the C library doesn't work right. - * - * @return Zero on success, negative on failure. Zero means CCPI lanes and links are - * functional. - */ -extern int __bdk_init_ccpi_connection(int is_master, uint64_t gbaud, int ccpi_trace); - -/** - * Brings the CCPI lanes and links into an operational state without enabling - * multi-node operation. Calling this function when the CCPI links are already - * up does nothing. This function must return zero before you can go multi-node - * by calling bdk_init_ccpi_multinode(). - * - * @param gbaud Baud rate to run links at. This is only used if the QLMs are in software init - * mode. If they are strapped for hardware init, the strapping speed is used. - * - * @return Zero on success, negative on failure. Zero means all CCPI links are functional. - */ -extern int __bdk_init_ccpi_links(uint64_t gbaud) BDK_WEAK; - -/** - * Once CCPI links are operational, this function transitions the system to a - * multi-node setup. Note that this function only performs the low level CCPI - * details, not BDK software setup on the other nodes. Call bdk_init_nodes() - * for high level access to multi-node. - * - * @return Zero on success, negative on failure - */ -extern int __bdk_init_ccpi_multinode(void) BDK_WEAK; - -/** - * This function is the first function run on all cores once the - * threading system takes over. - * - * @param arg - * @param arg1 - */ -extern void __bdk_init_main(int arg, void *arg1); - -/** - * Perform one time initialization for a node. Called for each - * node from the master node. - */ -extern void __bdk_init_node(bdk_node_t node); - -/** - * Set the baud rate on a UART - * - * @param node Node to use in a Numa setup. Can be an exact ID or a special - * value. - * @param uart uart to set - * @param baudrate Baud rate (9600, 19200, 115200, etc) - * @param use_flow_control - * Non zero if hardware flow control should be enabled - */ -extern void bdk_set_baudrate(bdk_node_t node, int uart, int baudrate, int use_flow_control); - -/** * Get the coremask of the cores actively running the BDK. Doesn't count cores * that aren't booted. * @@ -170,7 +80,7 @@ extern void bdk_set_baudrate(bdk_node_t node, int uart, int baudrate, int use_fl * * @return 64bit bitmask */ -extern uint64_t bdk_get_running_coremask(bdk_node_t node); +uint64_t bdk_get_running_coremask(bdk_node_t node); /** * Return the number of cores actively running in the BDK for the given node @@ -179,16 +89,8 @@ extern uint64_t bdk_get_running_coremask(bdk_node_t node); * * @return Number of cores running. Doesn't count cores that aren't booted */ -extern int bdk_get_num_running_cores(bdk_node_t node); - -#ifndef BDK_SHOW_BOOT_BANNERS -#define BDK_SHOW_BOOT_BANNERS 1 -#endif - -#define BDK_UART_BAUDRATE 115200 -//#define BDK_UART_BAUDRATE 921600 - -extern uint64_t __bdk_init_reg_x0; /* The contents of X0 when this image started */ -extern uint64_t __bdk_init_reg_x1; /* The contents of X1 when this image started */ +int bdk_get_num_running_cores(bdk_node_t node); /** @} */ + +#endif /* !__CB_BDK_INIT_H__ */ diff --git a/src/vendorcode/cavium/include/bdk/libbdk-os/bdk-thread.h b/src/vendorcode/cavium/include/bdk/libbdk-os/bdk-thread.h index ef62dd7fe3..863053ebb0 100644 --- a/src/vendorcode/cavium/include/bdk/libbdk-os/bdk-thread.h +++ b/src/vendorcode/cavium/include/bdk/libbdk-os/bdk-thread.h @@ -1,3 +1,5 @@ +#ifndef __CB_BDK_THREAD_H__ +#define __CB_BDK_THREAD_H__ /***********************license start*********************************** * Copyright (c) 2003-2017 Cavium Inc. (support@cavium.com). All rights * reserved. @@ -120,3 +122,4 @@ static inline void *bdk_thread_get_id(void) } /** @} */ +#endif /* !__CB_BDK_THREAD_H__ */ |