summaryrefslogtreecommitdiffstats
path: root/sys/mips/cavium
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2011-10-04 20:17:43 +0000
committermarcel <marcel@FreeBSD.org>2011-10-04 20:17:43 +0000
commit36e7af5118dbe7ba99b898f0507b1211adf6b71b (patch)
tree3c4db05f9483934a4daafed483064f428ebfedc5 /sys/mips/cavium
parent1485b2ad01c1e0d5adfdbcc6d06114ecaa15a950 (diff)
downloadFreeBSD-src-36e7af5118dbe7ba99b898f0507b1211adf6b71b.zip
FreeBSD-src-36e7af5118dbe7ba99b898f0507b1211adf6b71b.tar.gz
Remove octeon_bootinfo from all files except octeon_machdep.c.
Use instead cvmx_sysinfo_get() consistently. Reviewed by: jmallett, marcel Obtained from: Juniper Networks, Inc Author: Andrew Duane
Diffstat (limited to 'sys/mips/cavium')
-rw-r--r--sys/mips/cavium/if_octm.c4
-rw-r--r--sys/mips/cavium/octe/ethernet-common.c13
-rw-r--r--sys/mips/cavium/octe/ethernet.c8
-rw-r--r--sys/mips/cavium/octeon_ebt3000_cf.c5
-rw-r--r--sys/mips/cavium/octeon_mp.c5
5 files changed, 10 insertions, 25 deletions
diff --git a/sys/mips/cavium/if_octm.c b/sys/mips/cavium/if_octm.c
index a753d66..847ad3c 100644
--- a/sys/mips/cavium/if_octm.c
+++ b/sys/mips/cavium/if_octm.c
@@ -64,8 +64,6 @@
#include <contrib/octeon-sdk/cvmx-interrupt.h>
#include <contrib/octeon-sdk/cvmx-mgmt-port.h>
-extern cvmx_bootinfo_t *octeon_bootinfo;
-
struct octm_softc {
struct ifnet *sc_ifp;
device_t sc_dev;
@@ -179,7 +177,7 @@ octm_attach(device_t dev)
* Set MAC address for this management port.
*/
mac = 0;
- memcpy((u_int8_t *)&mac + 2, octeon_bootinfo->mac_addr_base, 6);
+ memcpy((u_int8_t *)&mac + 2, cvmx_sysinfo_get()->mac_addr_base, 6);
mac += sc->sc_port;
cvmx_mgmt_port_set_mac(sc->sc_port, mac);
diff --git a/sys/mips/cavium/octe/ethernet-common.c b/sys/mips/cavium/octe/ethernet-common.c
index 73103cc..839b6f8 100644
--- a/sys/mips/cavium/octe/ethernet-common.c
+++ b/sys/mips/cavium/octe/ethernet-common.c
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
#include "ethernet-headers.h"
extern int octeon_is_simulation(void);
-extern cvmx_bootinfo_t *octeon_bootinfo;
/**
@@ -270,12 +269,12 @@ void cvm_oct_common_poll(struct ifnet *ifp)
int cvm_oct_common_init(struct ifnet *ifp)
{
char mac[6] = {
- octeon_bootinfo->mac_addr_base[0],
- octeon_bootinfo->mac_addr_base[1],
- octeon_bootinfo->mac_addr_base[2],
- octeon_bootinfo->mac_addr_base[3],
- octeon_bootinfo->mac_addr_base[4],
- octeon_bootinfo->mac_addr_base[5] };
+ cvmx_sysinfo_get()->mac_addr_base[0],
+ cvmx_sysinfo_get()->mac_addr_base[1],
+ cvmx_sysinfo_get()->mac_addr_base[2],
+ cvmx_sysinfo_get()->mac_addr_base[3],
+ cvmx_sysinfo_get()->mac_addr_base[4],
+ cvmx_sysinfo_get()->mac_addr_base[5] };
cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc;
mac[5] += cvm_oct_mac_addr_offset++;
diff --git a/sys/mips/cavium/octe/ethernet.c b/sys/mips/cavium/octe/ethernet.c
index 50b91fc..a3a5ae7 100644
--- a/sys/mips/cavium/octe/ethernet.c
+++ b/sys/mips/cavium/octe/ethernet.c
@@ -77,12 +77,6 @@ TUNABLE_INT("hw.octe.pow_receive_group", &pow_receive_group);
extern int octeon_is_simulation(void);
/**
- * Exported from the kernel so we can determine board information. It is
- * passed by the bootloader to the kernel.
- */
-extern cvmx_bootinfo_t *octeon_bootinfo;
-
-/**
* Periodic timer to check auto negotiation
*/
static struct callout cvm_oct_poll_timer;
@@ -475,7 +469,7 @@ int cvm_oct_init_module(device_t bus)
if (INTERRUPT_LIMIT) {
/* Set the POW timer rate to give an interrupt at most INTERRUPT_LIMIT times per second */
- cvmx_write_csr(CVMX_POW_WQ_INT_PC, octeon_bootinfo->eclock_hz/(INTERRUPT_LIMIT*16*256)<<8);
+ cvmx_write_csr(CVMX_POW_WQ_INT_PC, cvmx_clock_get_rate(CVMX_CLOCK_CORE)/(INTERRUPT_LIMIT*16*256)<<8);
/* Enable POW timer interrupt. It will count when there are packets available */
cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0x1ful<<24);
diff --git a/sys/mips/cavium/octeon_ebt3000_cf.c b/sys/mips/cavium/octeon_ebt3000_cf.c
index bb553e8..ae7bb7e 100644
--- a/sys/mips/cavium/octeon_ebt3000_cf.c
+++ b/sys/mips/cavium/octeon_ebt3000_cf.c
@@ -100,9 +100,6 @@ __FBSDID("$FreeBSD$");
#define SWAP_SHORT(x) ((x << 8) | (x >> 8))
#define MODEL_STR_SIZE 40
-/* XXX */
-extern cvmx_bootinfo_t *octeon_bootinfo;
-
/* Globals */
/*
* There's three bus types supported by this driver.
@@ -648,7 +645,7 @@ static void cf_identify (driver_t *drv, device_t parent)
int count = 0;
cvmx_mio_boot_reg_cfgx_t cfg;
- uint64_t phys_base = octeon_bootinfo->compact_flash_common_base_addr;
+ uint64_t phys_base = cvmx_sysinfo_get()->compact_flash_common_base_addr;
if (octeon_is_simulation())
return;
diff --git a/sys/mips/cavium/octeon_mp.c b/sys/mips/cavium/octeon_mp.c
index 5cd73e8..9583977 100644
--- a/sys/mips/cavium/octeon_mp.c
+++ b/sys/mips/cavium/octeon_mp.c
@@ -43,9 +43,6 @@ __FBSDID("$FreeBSD$");
#include <contrib/octeon-sdk/cvmx.h>
#include <contrib/octeon-sdk/cvmx-interrupt.h>
-/* XXX */
-extern cvmx_bootinfo_t *octeon_bootinfo;
-
unsigned octeon_ap_boot = ~0;
void
@@ -105,7 +102,7 @@ platform_init_ap(int cpuid)
void
platform_cpu_mask(cpuset_t *mask)
{
- uint64_t core_mask = octeon_bootinfo->core_mask;
+ uint64_t core_mask = cvmx_sysinfo_get()->core_mask;
uint64_t i, m;
CPU_ZERO(mask);
OpenPOWER on IntegriCloud