/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2015-2016 Landon Fuller <[email protected]>4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer,11* without modification.12* 2. Redistributions in binary form must reproduce at minimum a disclaimer13* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any14* redistribution must be conditioned upon including a substantially15* similar Disclaimer requirement for further binary redistribution.16*17* NO WARRANTY18* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS19* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT20* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY21* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL22* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,23* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF24* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS25* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER26* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)27* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF28* THE POSSIBILITY OF SUCH DAMAGES.29*30*/3132#ifndef _BHND_CORES_CHIPC_CHIPC_H_33#define _BHND_CORES_CHIPC_CHIPC_H_3435#include <dev/bhnd/bhnd.h>36#include <dev/bhnd/nvram/bhnd_nvram.h>3738#include "bhnd_chipc_if.h"3940/**41* Supported ChipCommon flash types.42*/43typedef enum {44CHIPC_FLASH_NONE = 0, /**< No flash, or a type unrecognized45by the ChipCommon driver */46CHIPC_PFLASH_CFI = 1, /**< CFI-compatible parallel flash */47CHIPC_SFLASH_ST = 2, /**< ST serial flash */48CHIPC_SFLASH_AT = 3, /**< Atmel serial flash */49CHIPC_QSFLASH_ST = 4, /**< ST quad-SPI flash */50CHIPC_QSFLASH_AT = 5, /**< Atmel quad-SPI flash */51CHIPC_NFLASH = 6, /**< NAND flash */52CHIPC_NFLASH_4706 = 7 /**< BCM4706 NAND flash */53} chipc_flash;5455/**56* ChipCommon capability flags;57*/58struct chipc_caps {59uint8_t num_uarts; /**< Number of attached UARTS (1-3) */60bool mipseb; /**< MIPS is big-endian */61uint8_t uart_clock; /**< UART clock source (see CHIPC_CAP_UCLKSEL_*) */62uint8_t uart_gpio; /**< UARTs own GPIO pins 12-15 */6364uint8_t extbus_type; /**< ExtBus type (CHIPC_CAP_EXTBUS_*) */6566chipc_flash flash_type; /**< flash type */67uint8_t cfi_width; /**< CFI bus width, 0 if unknown or CFI68not present */6970bhnd_nvram_src nvram_src; /**< identified NVRAM source */71bus_size_t sprom_offset; /**< Offset to SPROM data within72SPROM/OTP, 0 if unknown or not73present */74uint8_t otp_size; /**< OTP (row?) size, 0 if not present */7576uint8_t pll_type; /**< PLL type */77bool pwr_ctrl; /**< Power/clock control available */78bool jtag_master; /**< JTAG Master present */79bool boot_rom; /**< Internal boot ROM is active */80uint8_t backplane_64; /**< Backplane supports 64-bit addressing.81Note that this does not gaurantee82the CPU itself supports 64-bit83addressing. */84bool pmu; /**< PMU is present. */85bool eci; /**< ECI (enhanced coexistence inteface) is present. */86bool seci; /**< SECI (serial ECI) is present */87bool sprom; /**< SPROM is present */88bool gsio; /**< GSIO (SPI/I2C) present */89bool aob; /**< AOB (always on bus) present.90If set, PMU and GCI registers are91not accessible via ChipCommon,92and are instead accessible via93dedicated cores on the bhnd bus */94};9596#endif /* _BHND_CORES_CHIPC_CHIPC_H_ */979899