PERFORCE change 148857 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Sat Aug 30 18:02:22 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=148857
Change 148857 by trasz at trasz_traszkan on 2008/08/30 18:02:11
IFC.
Affected files ...
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/Makefile#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/add.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/boot.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/create.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/destroy.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/gpt.8#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/gpt.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/gpt.h#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/label.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/map.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/map.h#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/migrate.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/recover.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/remove.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/sbin/gpt/show.c#2 delete
.. //depot/projects/soc2008/trasz_nfs4acl/share/man/man4/witness.4#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/arm/at91/if_ate.c#3 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/boot/sparc64/loader/main.c#3 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/ehci_pci.c#4 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/ohci_pci.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/uhci_pci.c#2 integrate
.. //depot/projects/soc2008/trasz_nfs4acl/sys/modules/usb/Makefile#2 integrate
Differences ...
==== //depot/projects/soc2008/trasz_nfs4acl/share/man/man4/witness.4#2 (text+ko) ====
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man4/witness.4,v 1.11 2005/07/31 03:30:44 keramida Exp $
+.\" $FreeBSD: src/share/man/man4/witness.4,v 1.12 2008/08/30 13:37:28 attilio Exp $
.\"
.Dd February 18, 2001
.Dt WITNESS 4
@@ -95,9 +95,10 @@
.Va debug.witness.watch
specifies the level of witness involvement in the system.
A value of 1 specifies that witness is enabled.
-A value of 0 specifies that witness is disabled.
-This sysctl can be written to in order to
-disable witness, however it may not be used to enable witness.
+A value of 0 specifies that witness is disabled, but that can be enabled
+again. This will maintain a small amount of overhead in the system.
+A value of -1 specifies that witness is disabled permanently and that
+cannot be enabled again.
The sysctl
.Va debug.witness.watch
can be set via
==== //depot/projects/soc2008/trasz_nfs4acl/sys/arm/at91/if_ate.c#3 (text) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/if_ate.c,v 1.24 2008/06/09 21:51:48 wkoszek Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/if_ate.c,v 1.26 2008/08/30 15:16:40 stas Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -170,7 +170,8 @@
struct sysctl_ctx_list *sctx;
struct sysctl_oid *soid;
int err;
- u_char eaddr[6];
+ u_char eaddr[ETHER_ADDR_LEN];
+ uint32_t rnd;
sc->dev = dev;
err = ate_activate(dev);
@@ -179,7 +180,7 @@
sc->use_rmii = (RD4(sc, ETH_CFG) & ETH_CFG_RMII) == ETH_CFG_RMII;
- /*Sysctls*/
+ /* Sysctls */
sctx = device_get_sysctl_ctx(dev);
soid = device_get_sysctl_tree(dev);
SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "rmii",
@@ -191,8 +192,23 @@
callout_init_mtx(&sc->tick_ch, &sc->sc_mtx, 0);
if ((err = ate_get_mac(sc, eaddr)) != 0) {
- device_printf(dev, "No MAC address set\n");
- goto out;
+ /*
+ * No MAC address configured. Generate the fake one.
+ */
+ if (bootverbose)
+ device_printf(dev,
+ "Generating fake ethernet address.\n");
+ rnd = arc4random();
+
+ /*
+ * Set OUI to Atmel.
+ */
+ eaddr[0] = 0x00;
+ eaddr[1] = 0x04;
+ eaddr[2] = 0x25;
+ eaddr[3] = (rnd >> 16) & 0xff;
+ eaddr[4] = (rnd >> 8) & 0xff;
+ eaddr[5] = rnd & 0xff;
}
ate_set_mac(sc, eaddr);
@@ -586,24 +602,29 @@
static int
ate_get_mac(struct ate_softc *sc, u_char *eaddr)
{
+ bus_size_t sa_low_reg[] = { ETH_SA1L, ETH_SA2L, ETH_SA3L, ETH_SA4L };
+ bus_size_t sa_high_reg[] = { ETH_SA1H, ETH_SA2H, ETH_SA3H, ETH_SA4H };
uint32_t low, high;
+ int i;
/*
* The boot loader setup the MAC with an address, if one is set in
- * the loader. The TSC loader will also set the MAC address in a
- * similar way. Grab the MAC address from the SA1[HL] registers.
+ * the loader. Grab one MAC address from the SA[1-4][HL] registers.
*/
- low = RD4(sc, ETH_SA1L);
- high = RD4(sc, ETH_SA1H);
- if ((low | (high & 0xffff)) == 0)
- return (ENXIO);
- eaddr[0] = low & 0xff;
- eaddr[1] = (low >> 8) & 0xff;
- eaddr[2] = (low >> 16) & 0xff;
- eaddr[3] = (low >> 24) & 0xff;
- eaddr[4] = high & 0xff;
- eaddr[5] = (high >> 8) & 0xff;
- return (0);
+ for (i = 0; i < 4; i++) {
+ low = RD4(sc, sa_low_reg[i]);
+ high = RD4(sc, sa_high_reg[i]);
+ if ((low | (high & 0xffff)) != 0) {
+ eaddr[0] = low & 0xff;
+ eaddr[1] = (low >> 8) & 0xff;
+ eaddr[2] = (low >> 16) & 0xff;
+ eaddr[3] = (low >> 24) & 0xff;
+ eaddr[4] = high & 0xff;
+ eaddr[5] = (high >> 8) & 0xff;
+ return (0);
+ }
+ }
+ return (ENXIO);
}
static void
==== //depot/projects/soc2008/trasz_nfs4acl/sys/boot/sparc64/loader/main.c#3 (text+ko) ====
@@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/sparc64/loader/main.c,v 1.34 2008/08/22 20:28:19 marius Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/sparc64/loader/main.c,v 1.35 2008/08/30 16:03:22 marius Exp $");
/*
* FreeBSD/sparc64 kernel loader - machine dependent part
@@ -36,6 +36,7 @@
#include <machine/tte.h>
#include <machine/tlb.h>
#include <machine/upa.h>
+#include <machine/ver.h>
#include "bootstrap.h"
#include "libofw.h"
@@ -57,8 +58,10 @@
typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3,
void *openfirmware);
+static inline u_long dtlb_get_data_sun4u(int slot);
static void dtlb_enter_sun4u(u_long vpn, u_long data);
static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t);
+static inline u_long itlb_get_data_sun4u(int slot);
static void itlb_enter_sun4u(u_long vpn, u_long data);
static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t);
extern vm_offset_t md_load(char *, vm_offset_t *);
@@ -92,6 +95,7 @@
struct tlb_entry *itlb_store;
int dtlb_slot;
int itlb_slot;
+int cpu_impl;
static int dtlb_slot_max;
static int itlb_slot_max;
@@ -365,6 +369,30 @@
panic("%s: exec returned", __func__);
}
+static inline u_long
+dtlb_get_data_sun4u(int slot)
+{
+
+ /*
+ * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work
+ * around errata of USIII and beyond.
+ */
+ (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG);
+ return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG));
+}
+
+static inline u_long
+itlb_get_data_sun4u(int slot)
+{
+
+ /*
+ * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work
+ * around errata of USIII and beyond.
+ */
+ (void)ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG);
+ return (ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG));
+}
+
static vm_offset_t
dtlb_va_to_pa_sun4u(vm_offset_t va)
{
@@ -375,7 +403,9 @@
reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG);
if (TLB_TAR_VA(reg) != va)
continue;
- reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG);
+ reg = dtlb_get_data_sun4u(i);
+ if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
+ return ((reg & TD_PA_CH_MASK) >> TD_PA_SHIFT);
return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT);
}
return (-1);
@@ -391,34 +421,38 @@
reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG);
if (TLB_TAR_VA(reg) != va)
continue;
- reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG);
+ reg = itlb_get_data_sun4u(i);
+ if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
+ return ((reg & TD_PA_CH_MASK) >> TD_PA_SHIFT);
return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT);
}
return (-1);
}
static void
-itlb_enter_sun4u(u_long vpn, u_long data)
+dtlb_enter_sun4u(u_long vpn, u_long data)
{
u_long reg;
reg = rdpr(pstate);
wrpr(pstate, reg & ~PSTATE_IE, 0);
- stxa(AA_IMMU_TAR, ASI_IMMU, vpn);
- stxa(0, ASI_ITLB_DATA_IN_REG, data);
+ stxa(AA_DMMU_TAR, ASI_DMMU,
+ TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
+ stxa(0, ASI_DTLB_DATA_IN_REG, data);
membar(Sync);
wrpr(pstate, reg, 0);
}
static void
-dtlb_enter_sun4u(u_long vpn, u_long data)
+itlb_enter_sun4u(u_long vpn, u_long data)
{
u_long reg;
reg = rdpr(pstate);
wrpr(pstate, reg & ~PSTATE_IE, 0);
- stxa(AA_DMMU_TAR, ASI_DMMU, vpn);
- stxa(0, ASI_DTLB_DATA_IN_REG, data);
+ stxa(AA_IMMU_TAR, ASI_IMMU,
+ TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
+ stxa(0, ASI_ITLB_DATA_IN_REG, data);
membar(Sync);
wrpr(pstate, reg, 0);
}
@@ -539,19 +573,18 @@
u_int bootcpu;
u_int cpu;
+ cpu_impl = VER_IMPL(rdpr(ver));
bootcpu = UPA_CR_GET_MID(ldxa(0, ASI_UPA_CONFIG_REG));
for (child = OF_child(root); child != 0; child = OF_peer(child)) {
- if (child == -1)
- panic("%s: can't get child phandle", __func__);
- if (OF_getprop(child, "device_type", buf, sizeof(buf)) > 0 &&
- strcmp(buf, "cpu") == 0) {
- if (OF_getprop(child, "upa-portid", &cpu,
- sizeof(cpu)) == -1 && OF_getprop(child, "portid",
- &cpu, sizeof(cpu)) == -1)
- panic("%s: can't get portid", __func__);
- if (cpu == bootcpu)
- break;
- }
+ if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0)
+ continue;
+ if (strcmp(buf, "cpu") != 0)
+ continue;
+ if (OF_getprop(child, cpu_impl < CPU_IMPL_ULTRASPARCIII ?
+ "upa-portid" : "portid", &cpu, sizeof(cpu)) <= 0)
+ continue;
+ if (cpu == bootcpu)
+ break;
}
if (cpu != bootcpu)
panic("%s: no node for bootcpu?!?!", __func__);
@@ -712,10 +745,14 @@
pmap_print_tlb_sun4u(void)
{
tte_t tag, tte;
+ u_long pstate;
int i;
+ pstate = rdpr(pstate);
for (i = 0; i < itlb_slot_max; i++) {
- tte = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG);
+ wrpr(pstate, pstate & ~PSTATE_IE, 0);
+ tte = itlb_get_data_sun4u(i);
+ wrpr(pstate, pstate, 0);
if (!(tte & TD_V))
continue;
tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG);
@@ -723,7 +760,9 @@
pmap_print_tte_sun4u(tag, tte);
}
for (i = 0; i < dtlb_slot_max; i++) {
- tte = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG);
+ wrpr(pstate, pstate & ~PSTATE_IE, 0);
+ tte = dtlb_get_data_sun4u(i);
+ wrpr(pstate, pstate, 0);
if (!(tte & TD_V))
continue;
tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG);
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/ehci_pci.c#4 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/ehci_pci.c,v 1.34 2008/07/30 19:16:53 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/ehci_pci.c,v 1.35 2008/08/30 16:23:04 imp Exp $");
/*
* USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller.
@@ -52,8 +52,6 @@
* sharing of code between *BSD's
*/
-#include "opt_bus.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/ohci_pci.c#2 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/ohci_pci.c,v 1.50 2007/06/21 14:42:33 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/ohci_pci.c,v 1.51 2008/08/30 16:23:04 imp Exp $");
/*
* USB Open Host Controller driver.
@@ -49,8 +49,6 @@
* sharing of code between *BSD's
*/
-#include "opt_bus.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
==== //depot/projects/soc2008/trasz_nfs4acl/sys/dev/usb/uhci_pci.c#2 (text+ko) ====
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/uhci_pci.c,v 1.64 2008/04/11 05:50:53 benno Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/uhci_pci.c,v 1.65 2008/08/30 16:21:16 imp Exp $");
/* Universal Host Controller Interface
*
@@ -48,8 +48,6 @@
* sharing of code between *BSD's
*/
-#include "opt_bus.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
==== //depot/projects/soc2008/trasz_nfs4acl/sys/modules/usb/Makefile#2 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/modules/usb/Makefile,v 1.18 2005/06/04 10:58:39 schweikh Exp $
+# $FreeBSD: src/sys/modules/usb/Makefile,v 1.19 2008/08/30 16:24:01 imp Exp $
S= ${.CURDIR}/../..
@@ -22,6 +22,6 @@
SRCS+= uhci_pci.c uhci.c uhcireg.h uhcivar.h
SRCS+= ohci_pci.c ohci.c ohcireg.h ohcivar.h
SRCS+= ehci_pci.c ehci.c ehcireg.h ehcivar.h
-SRCS+= opt_bus.h pci_if.h
+SRCS+= pci_if.h
.include <bsd.kmod.mk>
More information about the p4-projects
mailing list