Author: jmallett Date: Tue Oct 30 06:36:14 2012 New Revision: 242346 URL: http://svn.freebsd.org/changeset/base/242346
Log: Actually check board type rather than using a specialized octeon_is_simulation function. Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-rgmii.c head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octeon_ebt3000_cf.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/cavium/octeon_pcmap_regs.h Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet-common.c Tue Oct 30 06:36:14 2012 (r242346) @@ -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 *if /* * 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 *i /* * If this is a simulation, do nothing. */ - if (octeon_is_simulation()) + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM) return; /* Modified: head/sys/mips/cavium/octe/ethernet-rgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Oct 30 06:36:14 2012 (r242346) @@ -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 * 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); Modified: head/sys/mips/cavium/octe/ethernet-sgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-sgmii.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet-sgmii.c Tue Oct 30 06:36:14 2012 (r242346) @@ -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; Modified: head/sys/mips/cavium/octe/ethernet-xaui.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-xaui.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet-xaui.c Tue Oct 30 06:36:14 2012 (r242346) @@ -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; Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet.c Tue Oct 30 06:36:14 2012 (r242346) @@ -74,8 +74,6 @@ TUNABLE_INT("hw.octe.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( 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 */ Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- head/sys/mips/cavium/octeon_ebt3000_cf.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octeon_ebt3000_cf.c Tue Oct 30 06:36:14 2012 (r242346) @@ -590,7 +590,7 @@ static void cf_swap_ascii (unsigned char 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, 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); Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octeon_machdep.c Tue Oct 30 06:36:14 2012 (r242346) @@ -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) { Modified: head/sys/mips/cavium/octeon_pcmap_regs.h ============================================================================== --- head/sys/mips/cavium/octeon_pcmap_regs.h Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octeon_pcmap_regs.h Tue Oct 30 06:36:14 2012 (r242346) @@ -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__ */ _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"