Actually check board type rather than using a specialized octeon_is_simulation
function.
This commit is contained in:
parent
3fc2bc974b
commit
3631682eab
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=242346
@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include "wrapper-cvmx-includes.h"
|
||||
#include "ethernet-headers.h"
|
||||
|
||||
extern int octeon_is_simulation(void);
|
||||
|
||||
static uint64_t cvm_oct_mac_addr = 0;
|
||||
static uint32_t cvm_oct_mac_addr_offset = 0;
|
||||
|
||||
@ -243,7 +241,7 @@ int cvm_oct_common_open(struct ifnet *ifp)
|
||||
/*
|
||||
* Set the link state unless we are using MII.
|
||||
*/
|
||||
if (!octeon_is_simulation() && priv->miibus == NULL) {
|
||||
if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM && priv->miibus == NULL) {
|
||||
link_info = cvmx_helper_link_get(priv->port);
|
||||
if (!link_info.s.link_up)
|
||||
if_link_state_change(ifp, LINK_STATE_DOWN);
|
||||
@ -282,7 +280,7 @@ void cvm_oct_common_poll(struct ifnet *ifp)
|
||||
/*
|
||||
* If this is a simulation, do nothing.
|
||||
*/
|
||||
if (octeon_is_simulation())
|
||||
if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM)
|
||||
return;
|
||||
|
||||
/*
|
||||
|
@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "octebusvar.h"
|
||||
|
||||
extern int octeon_is_simulation(void);
|
||||
extern struct ifnet *cvm_oct_device[];
|
||||
|
||||
static struct mtx global_register_lock;
|
||||
@ -256,7 +255,7 @@ int cvm_oct_rgmii_init(struct ifnet *ifp)
|
||||
if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII) && (priv->port == 0)) ||
|
||||
(priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
|
||||
|
||||
if (!octeon_is_simulation()) {
|
||||
if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) {
|
||||
|
||||
cvmx_gmxx_rxx_int_en_t gmx_rx_int_en;
|
||||
int interface = INTERFACE(priv->port);
|
||||
@ -285,7 +284,7 @@ void cvm_oct_rgmii_uninit(struct ifnet *ifp)
|
||||
if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII) && (priv->port == 0)) ||
|
||||
(priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) {
|
||||
|
||||
if (!octeon_is_simulation()) {
|
||||
if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) {
|
||||
|
||||
cvmx_gmxx_rxx_int_en_t gmx_rx_int_en;
|
||||
int interface = INTERFACE(priv->port);
|
||||
|
@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include "wrapper-cvmx-includes.h"
|
||||
#include "ethernet-headers.h"
|
||||
|
||||
extern int octeon_is_simulation(void);
|
||||
|
||||
int cvm_oct_sgmii_init(struct ifnet *ifp)
|
||||
{
|
||||
cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
|
||||
|
@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include "wrapper-cvmx-includes.h"
|
||||
#include "ethernet-headers.h"
|
||||
|
||||
extern int octeon_is_simulation(void);
|
||||
|
||||
int cvm_oct_xaui_init(struct ifnet *ifp)
|
||||
{
|
||||
cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
|
||||
|
@ -74,8 +74,6 @@ TUNABLE_INT("hw.octe.pow_receive_group", &pow_receive_group);
|
||||
"\t\tgroup. Also any other software can submit packets to this\n"
|
||||
"\t\tgroup for the kernel to process." */
|
||||
|
||||
extern int octeon_is_simulation(void);
|
||||
|
||||
/**
|
||||
* Periodic timer to check auto negotiation
|
||||
*/
|
||||
@ -228,7 +226,7 @@ static void cvm_oct_configure_common_hw(device_t bus)
|
||||
num_packet_buffers/8);
|
||||
|
||||
/* Enable the MII interface */
|
||||
if (!octeon_is_simulation())
|
||||
if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM)
|
||||
cvmx_write_csr(CVMX_SMI_EN, 1);
|
||||
|
||||
/* Register an IRQ hander for to receive POW interrupts */
|
||||
|
@ -590,7 +590,7 @@ static void cf_swap_ascii (unsigned char str1[], char str2[])
|
||||
|
||||
static int cf_probe (device_t dev)
|
||||
{
|
||||
if (octeon_is_simulation())
|
||||
if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM)
|
||||
return (ENXIO);
|
||||
|
||||
if (device_get_unit(dev) != 0) {
|
||||
@ -618,7 +618,7 @@ static void cf_identify (driver_t *drv, device_t parent)
|
||||
cvmx_mio_boot_reg_cfgx_t cfg;
|
||||
uint64_t phys_base;
|
||||
|
||||
if (octeon_is_simulation())
|
||||
if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM)
|
||||
return;
|
||||
|
||||
phys_base = cvmx_sysinfo_get()->compact_flash_common_base_addr;
|
||||
@ -694,7 +694,7 @@ static int cf_attach (device_t dev)
|
||||
struct cf_priv *cf_priv;
|
||||
int error;
|
||||
|
||||
if (octeon_is_simulation())
|
||||
if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM)
|
||||
return (ENXIO);
|
||||
|
||||
cf_priv = device_get_softc(dev);
|
||||
|
@ -211,7 +211,7 @@ octeon_memory_init(void)
|
||||
|
||||
phys_end = round_page(MIPS_KSEG0_TO_PHYS((vm_offset_t)&end));
|
||||
|
||||
if (octeon_is_simulation()) {
|
||||
if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM) {
|
||||
/* Simulator we limit to 96 meg */
|
||||
phys_avail[0] = phys_end;
|
||||
phys_avail[1] = 96 << 20;
|
||||
@ -518,17 +518,6 @@ cvmx_bootinfo_t *octeon_bootinfo;
|
||||
|
||||
static octeon_boot_descriptor_t *app_desc_ptr;
|
||||
|
||||
int
|
||||
octeon_is_simulation(void)
|
||||
{
|
||||
switch (cvmx_sysinfo_get()->board_type) {
|
||||
case CVMX_BOARD_TYPE_SIM:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
octeon_process_app_desc_ver_6(void)
|
||||
{
|
||||
|
@ -54,7 +54,6 @@
|
||||
*/
|
||||
void octeon_debug_symbol(void);
|
||||
void octeon_ciu_reset(void);
|
||||
int octeon_is_simulation(void);
|
||||
#endif /* LOCORE */
|
||||
|
||||
#endif /* !OCTEON_PCMAP_REGS_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user