diff options
author | Aaron Williams <awilliams@marvell.com> | 2022-04-07 09:11:28 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2022-05-04 03:38:21 +0200 |
commit | 2aab1c237027c5e9c55e5cb30a752086e3d5e1c3 (patch) | |
tree | 3ffbc735c691c0e590e2e97bca82d960da7aae4c /arch/mips/mach-octeon | |
parent | 16c50d61eecced0a288ef2e26da5cf5e6c5428ff (diff) | |
download | u-boot-2aab1c237027c5e9c55e5cb30a752086e3d5e1c3.tar.gz u-boot-2aab1c237027c5e9c55e5cb30a752086e3d5e1c3.tar.bz2 u-boot-2aab1c237027c5e9c55e5cb30a752086e3d5e1c3.zip |
mips: octeon: Add cvmx-fau-compat.c
Import cvmx-fau-compat.c from 2013 U-Boot. It will be used by the later
added drivers to support networking on the MIPS Octeon II / III
platforms.
Signed-off-by: Aaron Williams <awilliams@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/mips/mach-octeon')
-rw-r--r-- | arch/mips/mach-octeon/cvmx-fau-compat.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/mips/mach-octeon/cvmx-fau-compat.c b/arch/mips/mach-octeon/cvmx-fau-compat.c new file mode 100644 index 0000000000..9c2ff763ad --- /dev/null +++ b/arch/mips/mach-octeon/cvmx-fau-compat.c @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018-2022 Marvell International Ltd. + */ + +#include <log.h> +#include <time.h> +#include <linux/delay.h> + +#include <mach/cvmx-regs.h> +#include <mach/cvmx-csr.h> +#include <mach/cvmx-bootmem.h> +#include <mach/octeon-model.h> +#include <mach/cvmx-fuse.h> +#include <mach/octeon-feature.h> +#include <mach/cvmx-qlm.h> +#include <mach/octeon_qlm.h> +#include <mach/cvmx-pcie.h> +#include <mach/cvmx-coremask.h> + +#include <mach/cvmx-global-resources.h> + +#include <mach/cvmx-pki.h> +#include <mach/cvmx-helper.h> +#include <mach/cvmx-helper-board.h> +#include <mach/cvmx-helper-cfg.h> + +#include <mach/cvmx-hwfau.h> + +u8 *cvmx_fau_regs_ptr; + +void cvmx_fau_bootmem_init(void *bootmem) +{ + memset(bootmem, 0, CVMX_FAU_MAX_REGISTERS_8); +} + +/** + * Initializes FAU region for devices without FAU unit. + * @return 0 on success -1 on failure + */ +int cvmx_fau_init(void) +{ + cvmx_fau_regs_ptr = (u8 *)cvmx_bootmem_alloc_named_range_once( + CVMX_FAU_MAX_REGISTERS_8, 0, 1ull << 31, 128, + "cvmx_fau_registers", cvmx_fau_bootmem_init); + + if (cvmx_fau_regs_ptr == 0ull) { + debug("ERROR: Failed to alloc named block for software FAU.\n"); + return -1; + } + + return 0; +} |