Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Oct 2011 20:17:43 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r226024 - in head/sys/mips/cavium: . octe
Message-ID:  <201110042017.p94KHhNu077514@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Tue Oct  4 20:17:43 2011
New Revision: 226024
URL: http://svn.freebsd.org/changeset/base/226024

Log:
  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

Modified:
  head/sys/mips/cavium/if_octm.c
  head/sys/mips/cavium/octe/ethernet-common.c
  head/sys/mips/cavium/octe/ethernet.c
  head/sys/mips/cavium/octeon_ebt3000_cf.c
  head/sys/mips/cavium/octeon_mp.c

Modified: head/sys/mips/cavium/if_octm.c
==============================================================================
--- head/sys/mips/cavium/if_octm.c	Tue Oct  4 19:07:38 2011	(r226023)
+++ head/sys/mips/cavium/if_octm.c	Tue Oct  4 20:17:43 2011	(r226024)
@@ -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);
 

Modified: head/sys/mips/cavium/octe/ethernet-common.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet-common.c	Tue Oct  4 19:07:38 2011	(r226023)
+++ head/sys/mips/cavium/octe/ethernet-common.c	Tue Oct  4 20:17:43 2011	(r226024)
@@ -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 *i
 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++;

Modified: head/sys/mips/cavium/octe/ethernet.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet.c	Tue Oct  4 19:07:38 2011	(r226023)
+++ head/sys/mips/cavium/octe/ethernet.c	Tue Oct  4 20:17:43 2011	(r226024)
@@ -77,12 +77,6 @@ TUNABLE_INT("hw.octe.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);

Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c
==============================================================================
--- head/sys/mips/cavium/octeon_ebt3000_cf.c	Tue Oct  4 19:07:38 2011	(r226023)
+++ head/sys/mips/cavium/octeon_ebt3000_cf.c	Tue Oct  4 20:17:43 2011	(r226024)
@@ -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, 
 	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;

Modified: head/sys/mips/cavium/octeon_mp.c
==============================================================================
--- head/sys/mips/cavium/octeon_mp.c	Tue Oct  4 19:07:38 2011	(r226023)
+++ head/sys/mips/cavium/octeon_mp.c	Tue Oct  4 20:17:43 2011	(r226024)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110042017.p94KHhNu077514>