History log of /freebsd-10-stable/sys/mips/cavium/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
314667 04-Mar-2017 avg

MFC r283291: don't use CALLOUT_MPSAFE with callout_init()

The main purpose of this MFC is to reduce conflicts for other merges.
Parts of the original change have already "trickled down" via individual MFCs.


/freebsd-10-stable/sys/amd64/amd64/mp_watchdog.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
/freebsd-10-stable/sys/cddl/dev/profile/profile.c
/freebsd-10-stable/sys/compat/ndis/subr_ntoskrnl.c
/freebsd-10-stable/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
/freebsd-10-stable/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c
/freebsd-10-stable/sys/dev/ath/if_ath.c
/freebsd-10-stable/sys/dev/ce/if_ce.c
/freebsd-10-stable/sys/dev/cp/if_cp.c
/freebsd-10-stable/sys/dev/ctau/if_ct.c
/freebsd-10-stable/sys/dev/cx/if_cx.c
/freebsd-10-stable/sys/dev/cxgb/cxgb_main.c
/freebsd-10-stable/sys/dev/cxgb/cxgb_sge.c
/freebsd-10-stable/sys/dev/dcons/dcons_os.c
/freebsd-10-stable/sys/dev/drm2/drm_irq.c
/freebsd-10-stable/sys/dev/drm2/i915/intel_display.c
/freebsd-10-stable/sys/dev/glxsb/glxsb.c
/freebsd-10-stable/sys/dev/gxemul/cons/gxemul_cons.c
/freebsd-10-stable/sys/dev/hifn/hifn7751.c
/freebsd-10-stable/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
/freebsd-10-stable/sys/dev/if_ndis/if_ndis.c
/freebsd-10-stable/sys/dev/isci/isci_io_request.c
/freebsd-10-stable/sys/dev/mfi/mfi.c
/freebsd-10-stable/sys/dev/mwl/if_mwl.c
/freebsd-10-stable/sys/dev/nand/nandsim_chip.c
/freebsd-10-stable/sys/dev/ntb/ntb_hw/ntb_hw.c
/freebsd-10-stable/sys/dev/nxge/if_nxge.c
/freebsd-10-stable/sys/dev/oce/oce_if.c
/freebsd-10-stable/sys/dev/patm/if_patm_attach.c
/freebsd-10-stable/sys/dev/rndtest/rndtest.c
/freebsd-10-stable/sys/dev/safe/safe.c
/freebsd-10-stable/sys/dev/sound/midi/mpu401.c
/freebsd-10-stable/sys/dev/sound/pci/atiixp.c
/freebsd-10-stable/sys/dev/sound/pci/es137x.c
/freebsd-10-stable/sys/dev/sound/pci/hda/hdaa.c
/freebsd-10-stable/sys/dev/sound/pci/hda/hdac.c
/freebsd-10-stable/sys/dev/sound/pci/via8233.c
/freebsd-10-stable/sys/dev/twa/tw_osl_freebsd.c
/freebsd-10-stable/sys/dev/tws/tws.c
/freebsd-10-stable/sys/dev/ubsec/ubsec.c
/freebsd-10-stable/sys/dev/virtio/random/virtio_random.c
/freebsd-10-stable/sys/dev/xen/netfront/netfront.c
/freebsd-10-stable/sys/fs/nfs/nfs_commonport.c
/freebsd-10-stable/sys/gdb/gdb_cons.c
/freebsd-10-stable/sys/geom/gate/g_gate.c
/freebsd-10-stable/sys/geom/journal/g_journal.c
/freebsd-10-stable/sys/geom/mirror/g_mirror.c
/freebsd-10-stable/sys/geom/raid3/g_raid3.c
/freebsd-10-stable/sys/geom/sched/gs_rr.c
/freebsd-10-stable/sys/i386/i386/mp_watchdog.c
/freebsd-10-stable/sys/kern/init_main.c
/freebsd-10-stable/sys/kern/kern_synch.c
/freebsd-10-stable/sys/kern/kern_thread.c
/freebsd-10-stable/sys/kern/subr_vmem.c
/freebsd-10-stable/sys/kern/uipc_domain.c
octe/ethernet.c
octeon_rnd.c
/freebsd-10-stable/sys/mips/nlm/dev/net/xlpge.c
/freebsd-10-stable/sys/mips/rmi/dev/xlr/rge.c
/freebsd-10-stable/sys/net/if_spppsubr.c
/freebsd-10-stable/sys/net80211/ieee80211_ht.c
/freebsd-10-stable/sys/net80211/ieee80211_hwmp.c
/freebsd-10-stable/sys/net80211/ieee80211_mesh.c
/freebsd-10-stable/sys/net80211/ieee80211_node.c
/freebsd-10-stable/sys/net80211/ieee80211_proto.c
/freebsd-10-stable/sys/netgraph/netflow/ng_netflow.c
/freebsd-10-stable/sys/netgraph/netgraph.h
/freebsd-10-stable/sys/netinet/in_pcb.c
/freebsd-10-stable/sys/netinet/ip_mroute.c
/freebsd-10-stable/sys/netinet/tcp_hostcache.c
/freebsd-10-stable/sys/netinet/tcp_subr.c
/freebsd-10-stable/sys/netinet6/in6_rmx.c
/freebsd-10-stable/sys/netpfil/ipfw/ip_dummynet.c
/freebsd-10-stable/sys/netpfil/ipfw/ip_fw_dynamic.c
/freebsd-10-stable/sys/netpfil/pf/if_pfsync.c
/freebsd-10-stable/sys/ofed/include/linux/timer.h
/freebsd-10-stable/sys/ofed/include/linux/workqueue.h
/freebsd-10-stable/sys/powerpc/mambo/mambo_console.c
/freebsd-10-stable/sys/powerpc/pseries/phyp_console.c
/freebsd-10-stable/sys/sys/callout.h
/freebsd-10-stable/sys/vm/uma_core.c
/freebsd-10-stable/sys/x86/x86/mca.c
308402 07-Nov-2016 hselasky

MFC r307518:
Fix device delete child function.

When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().

Device drivers implementing trees, must ensure its detach function
detaches or deletes all its children before returning.

While at it remove now redundant device_detach() calls before
device_delete_child() and device_delete_children(), mostly in
the USB controller drivers.

Tested by: Jan Henrik Sylvester <me@janh.de>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D8070

278786 14-Feb-2015 loos

MFC r274670, r274671, r276168:

Moves all the duplicate code to a single function.

Verify for invalid modes and unwanted flags before pass the new flags to
driver.

Make gpio_default_map_gpios() static. No functional changes.

Improves the GPIO API description a little bit.

gpio_pin_max must return the maximum supported pin number and not the total
number of pins on the system.

278782 14-Feb-2015 loos

MFC r273799:

Make the GPIO children attach to the first unit available and not only to
unit 0.

This fix a bug where a GPIO controller could fail to attach its children
(gpioc and gpiobus) if another GPIO driver attach first.

278278 05-Feb-2015 hselasky

MFC r266969 and r276717:
Add 64-bit DMA support in the XHCI controller driver.
- Fix some comments and whitespaces while at it.
- Add support for PAE.


/freebsd-10-stable/sys/arm/allwinner/a10_ehci.c
/freebsd-10-stable/sys/arm/cavium/cns11xx/ehci_ebus.c
/freebsd-10-stable/sys/arm/cavium/cns11xx/ohci_ec.c
/freebsd-10-stable/sys/arm/freescale/vybrid/vf_ehci.c
/freebsd-10-stable/sys/arm/lpc/lpc_ohci.c
/freebsd-10-stable/sys/arm/samsung/exynos/exynos5_ehci.c
/freebsd-10-stable/sys/arm/ti/am335x/am335x_usbss.c
/freebsd-10-stable/sys/arm/ti/usb/omap_ehci.c
/freebsd-10-stable/sys/arm/xilinx/zy7_ehci.c
/freebsd-10-stable/sys/dev/usb/controller/at91dci_atmelarm.c
/freebsd-10-stable/sys/dev/usb/controller/at91dci_fdt.c
/freebsd-10-stable/sys/dev/usb/controller/atmegadci_atmelarm.c
/freebsd-10-stable/sys/dev/usb/controller/dwc_otg_atmelarm.c
/freebsd-10-stable/sys/dev/usb/controller/dwc_otg_fdt.c
/freebsd-10-stable/sys/dev/usb/controller/ehci_fsl.c
/freebsd-10-stable/sys/dev/usb/controller/ehci_imx.c
/freebsd-10-stable/sys/dev/usb/controller/ehci_ixp4xx.c
/freebsd-10-stable/sys/dev/usb/controller/ehci_mv.c
/freebsd-10-stable/sys/dev/usb/controller/ehci_pci.c
/freebsd-10-stable/sys/dev/usb/controller/musb_otg_atmelarm.c
/freebsd-10-stable/sys/dev/usb/controller/ohci_atmelarm.c
/freebsd-10-stable/sys/dev/usb/controller/ohci_fdt.c
/freebsd-10-stable/sys/dev/usb/controller/ohci_pci.c
/freebsd-10-stable/sys/dev/usb/controller/ohci_s3c24x0.c
/freebsd-10-stable/sys/dev/usb/controller/uhci_pci.c
/freebsd-10-stable/sys/dev/usb/controller/usb_controller.c
/freebsd-10-stable/sys/dev/usb/controller/uss820dci_atmelarm.c
/freebsd-10-stable/sys/dev/usb/controller/xhci.c
/freebsd-10-stable/sys/dev/usb/controller/xhci_pci.c
/freebsd-10-stable/sys/dev/usb/usb_bus.h
/freebsd-10-stable/sys/dev/usb/usb_busdma.h
/freebsd-10-stable/sys/dev/usb/usb_transfer.c
/freebsd-10-stable/sys/mips/atheros/ar71xx_ehci.c
/freebsd-10-stable/sys/mips/atheros/ar71xx_ohci.c
usb/octusb_octeon.c
/freebsd-10-stable/sys/mips/rmi/xls_ehci.c
/freebsd-10-stable/sys/mips/rt305x/rt305x_dotg.c
/freebsd-10-stable/sys/powerpc/ps3/ehci_ps3.c
/freebsd-10-stable/sys/powerpc/ps3/ohci_ps3.c
265999 14-May-2014 ian

MFC r257334, r257336, r257337, r257338, r257341, r257342, r257343, r257370,
r257368, r257416

Hints-only devices should return BUS_PROBE_NOWILDCARD from their probe
methods.


/freebsd-10-stable/sys/arm/at91/at91.c
/freebsd-10-stable/sys/arm/econa/econa.c
/freebsd-10-stable/sys/arm/s3c2xx0/s3c24x0.c
/freebsd-10-stable/sys/arm/sa11x0/sa11x0.c
/freebsd-10-stable/sys/arm/xscale/i80321/iq80321.c
/freebsd-10-stable/sys/arm/xscale/pxa/pxa_obio.c
/freebsd-10-stable/sys/dev/acpica/acpi.c
/freebsd-10-stable/sys/dev/altera/atse/if_atse_nexus.c
/freebsd-10-stable/sys/dev/altera/avgen/altera_avgen_nexus.c
/freebsd-10-stable/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c
/freebsd-10-stable/sys/dev/altera/sdcard/altera_sdcard_nexus.c
/freebsd-10-stable/sys/dev/cfe/cfe_resource.c
/freebsd-10-stable/sys/dev/gxemul/disk/gxemul_disk.c
/freebsd-10-stable/sys/dev/gxemul/ether/if_gx.c
/freebsd-10-stable/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
/freebsd-10-stable/sys/dev/rt/if_rt.c
/freebsd-10-stable/sys/dev/terasic/de4led/terasic_de4led_nexus.c
/freebsd-10-stable/sys/dev/terasic/mtl/terasic_mtl_nexus.c
/freebsd-10-stable/sys/dev/xen/console/console.c
/freebsd-10-stable/sys/dev/xen/pcifront/pcifront.c
/freebsd-10-stable/sys/dev/xen/timer/timer.c
/freebsd-10-stable/sys/mips/adm5120/obio.c
/freebsd-10-stable/sys/mips/alchemy/obio.c
/freebsd-10-stable/sys/mips/atheros/apb.c
/freebsd-10-stable/sys/mips/atheros/ar71xx_ehci.c
/freebsd-10-stable/sys/mips/atheros/ar71xx_pci.c
/freebsd-10-stable/sys/mips/atheros/ar71xx_spi.c
/freebsd-10-stable/sys/mips/atheros/ar71xx_wdog.c
/freebsd-10-stable/sys/mips/atheros/ar724x_pci.c
/freebsd-10-stable/sys/mips/atheros/if_arge.c
ciu.c
octeon_ebt3000_cf.c
octeon_pmc.c
octeon_rnd.c
octeon_rtc.c
/freebsd-10-stable/sys/mips/idt/obio.c
/freebsd-10-stable/sys/mips/malta/gt.c
/freebsd-10-stable/sys/mips/mips/tick.c
/freebsd-10-stable/sys/mips/nlm/tick.c
/freebsd-10-stable/sys/mips/nlm/xlp_pci.c
/freebsd-10-stable/sys/mips/rmi/iodi.c
/freebsd-10-stable/sys/mips/rmi/tick.c
/freebsd-10-stable/sys/mips/rt305x/obio.c
/freebsd-10-stable/sys/mips/sibyte/sb_zbbus.c
/freebsd-10-stable/sys/modules/Makefile
/freebsd-10-stable/sys/powerpc/pseries/plpar_iommu.c
263687 24-Mar-2014 emaste

MFC r263289: Update NetBSD Foundation copyrights to 2-clause BSD

The NetBSD Foundation states "Third parties are encouraged to change the
license on any files which have a 4-clause license contributed to the
NetBSD Foundation to a 2-clause license."

This change removes clauses 3 and 4 from copyright / license blocks that
list The NetBSD Foundation as the only copyright holder.

Sponsored by: The FreeBSD Foundation


/freebsd-10-stable/contrib/file/mygetopt.h
/freebsd-10-stable/contrib/pf/pflogd/pidfile.c
/freebsd-10-stable/contrib/tnftp/COPYING
/freebsd-10-stable/contrib/vis/extern.h
/freebsd-10-stable/lib/libedit/chartype.h
/freebsd-10-stable/share/man/man9/bus_dma.9
/freebsd-10-stable/share/man/man9/bus_space.9
/freebsd-10-stable/sys/compat/svr4/svr4_fuser.h
/freebsd-10-stable/sys/compat/svr4/svr4_ipc.c
/freebsd-10-stable/sys/compat/svr4/svr4_resource.c
/freebsd-10-stable/sys/compat/svr4/svr4_resource.h
/freebsd-10-stable/sys/dev/esp/ncr53c9xvar.h
/freebsd-10-stable/sys/dev/le/am7990.c
/freebsd-10-stable/sys/dev/le/am79900.c
/freebsd-10-stable/sys/dev/le/am79900reg.h
/freebsd-10-stable/sys/dev/le/am7990reg.h
/freebsd-10-stable/sys/dev/le/if_le_isa.c
/freebsd-10-stable/sys/dev/le/if_le_pci.c
/freebsd-10-stable/sys/dev/le/lance.c
/freebsd-10-stable/sys/dev/le/lancereg.h
/freebsd-10-stable/sys/dev/usb/serial/ubsa.c
/freebsd-10-stable/sys/dev/usb/serial/ubser.c
/freebsd-10-stable/sys/dev/usb/serial/uchcom.c
/freebsd-10-stable/sys/dev/usb/serial/ufoma.c
/freebsd-10-stable/sys/dev/usb/serial/umodem.c
/freebsd-10-stable/sys/dev/usb/serial/uplcom.c
/freebsd-10-stable/sys/dev/usb/serial/usb_serial.c
/freebsd-10-stable/sys/dev/usb/serial/usb_serial.h
octopci_bus_space.c
/freebsd-10-stable/sys/mips/include/bus.h
/freebsd-10-stable/sys/mips/mips/bus_space_fdt.c
/freebsd-10-stable/sys/mips/mips/bus_space_generic.c
/freebsd-10-stable/sys/mips/mips/gdb_machdep.c
/freebsd-10-stable/sys/powerpc/aim/mmu_oea.c
/freebsd-10-stable/sys/powerpc/aim/mmu_oea64.c
/freebsd-10-stable/sys/powerpc/aim/moea64_native.c
/freebsd-10-stable/sys/powerpc/include/bat.h
/freebsd-10-stable/sys/powerpc/include/bus.h
/freebsd-10-stable/sys/sys/bus_dma.h
/freebsd-10-stable/sys/tools/miidevs2h.awk
/freebsd-10-stable/sys/tools/pccarddevs2h.awk
/freebsd-10-stable/sys/x86/include/bus.h
262649 01-Mar-2014 imp

MFC: r260889, r260890, r260911:

r260911 | imp | 2014-01-20 10:45:36 -0700 (Mon, 20 Jan 2014) | 5 lines

Don't lock in the generic grab just to lock again in the specific grabs.

r260890 | imp | 2014-01-19 12:39:13 -0700 (Sun, 19 Jan 2014) | 11 lines

Introduce grab and ungrab upcalls. When the kernel desires to grab the
console, it calls the grab functions. These functions should turn off
the RX interrupts, and any others that interfere. This makes mountroot
prompt work again. If there's more generalized need other than
prompting, many of these routines should be expanded to do those new
things.

Reviewed by: bde (with reservations)

256381 12-Oct-2013 markm

Merge from project branch via main. Uninteresting commits are trimmed.

Refactor of /dev/random device. Main points include:

* Userland seeding is no longer used. This auto-seeds at boot time
on PC/Desktop setups; this may need some tweeking and intelligence
from those folks setting up embedded boxes, but the work is believed
to be minimal.

* An entropy cache is written to /entropy (even during installation)
and the kernel uses this at next boot.

* An entropy file written to /boot/entropy can be loaded by loader(8)

* Hardware sources such as rdrand are fed into Yarrow, and are no
longer available raw.

------------------------------------------------------------------------
r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines

Add a RANDOM_RWFILE option and hide the entropy cache code behind it.
Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA.
Add the RANDOM_* options to LINT.

------------------------------------------------------------------------
r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines

Define RANDOM_PURE_RNDTEST for rndtest(4).

------------------------------------------------------------------------
r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines

staticize struct random_hardware_source

------------------------------------------------------------------------
r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines

Wrap some policy-rich code in 'if NOTYET' until we can thresh out
what it really needs to do.

------------------------------------------------------------------------
r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines

Re-add /dev/urandom for compatibility purposes.

------------------------------------------------------------------------
r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines

Add missing include guards and move the existing ones out of the
implementation namespace.

------------------------------------------------------------------------
r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lines

Fix some just-noticed problems:

o Allow this to work with "nodevice random" by fixing where the
MALLOC pool is defined.

o Fix the explicit reseed code. This was correct as submitted, but
in the project branch doesn't need to set the "seeded" bit as this
is done correctly in the "unblock" function.

o Remove some debug ifdeffing.

o Adjust comments.

------------------------------------------------------------------------
r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines

Time to eat crow for me.

I replaced the sx_* locks that Arthur used with regular mutexes;
this turned out the be the wrong thing to do as the locks need to
be sleepable. Revert this folly.

# Submitted by: Arthur Mesh <arthurmesh@gmail.com> (In original diff)

------------------------------------------------------------------------
r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines

Add YARROW_RNG and FORTUNA_RNG to sys/conf/options.

Add a SYSINIT that forces a reseed during proc0 setup, which happens
fairly late in the boot process.

Add a RANDOM_DEBUG option which enables some debugging printf()s.

Add a new RANDOM_ATTACH entropy source which harvests entropy from the
get_cyclecount() delta across each call to a device attach method.

------------------------------------------------------------------------
r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines

Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use
EVENTHANDLER(mountroot) instead.

This means we can't count on /var being present, so something will
need to be done about harvesting /var/db/entropy/... .

Some policy now needs to be sorted out, and a pre-sync cache needs
to be written, but apart from that we are now ready to go.

Over to review.

------------------------------------------------------------------------
r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines

Snapshot.

Looking pretty good; this mostly works now. New code includes:

* Read cached entropy at startup, both from files and from loader(8)
preloaded entropy. Failures are soft, but announced. Untested.

* Use EVENTHANDLER to do above just before we go multiuser. Untested.

------------------------------------------------------------------------
r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines

Fix up the man page for random(4). This mainly removes no-longer-relevant
details about HW RNGs, reseeding explicitly and user-supplied
entropy.

------------------------------------------------------------------------
r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines

As userland writing to /dev/random is no more, remove the "better
than nothing" bootstrap mode.

Add SWI harvesting to the mix.

My box seeds Yarrow by itself in a few seconds! YMMV; more to follow.

------------------------------------------------------------------------
r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lines

Debug run. This now works, except that the "live" sources haven't
been tested. With all sources turned on, this unlocks itself in
a couple of seconds! That is no my box, and there is no guarantee
that this will be the case everywhere.

* Cut debug prints.

* Use the same locks/mutexes all the way through.

* Be a tad more conservative about entropy estimates.

------------------------------------------------------------------------
r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines

Don't use the "real" assembler mnemonics; older compilers may not
understand them (like when building CURRENT on 9.x).

# Submitted by: Konstantin Belousov <kostikbel@gmail.com>

------------------------------------------------------------------------
r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lines

SNAPSHOT.

Simplify the malloc pools; We only need one for this device.

Simplify the harvest queue.

Marginally improve the entropy pool hashing, making it a bit faster
in the process.

Connect up the hardware "live" source harvesting. This is simplistic
for now, and will need to be made rate-adaptive.

All of the above passes a compile test but needs to be debugged.

------------------------------------------------------------------------
r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lines

Snapshot. This passes the build test, but has not yet been finished or debugged.

Contains:

* Refactor the hardware RNG CPU instruction sources to feed into
the software mixer. This is unfinished. The actual harvesting needs
to be sorted out. Modified by me (see below).

* Remove 'frac' parameter from random_harvest(). This was never
used and adds extra code for no good reason.

* Remove device write entropy harvesting. This provided a weak
attack vector, was not very good at bootstrapping the device. To
follow will be a replacement explicit reseed knob.

* Separate out all the RANDOM_PURE sources into separate harvest
entities. This adds some secuity in the case where more than one
is present.

* Review all the code and fix anything obviously messy or inconsistent.
Address som review concerns while I'm here, like rename the pseudo-rng
to 'dummy'.

# Submitted by: Arthur Mesh <arthurmesh@gmail.com> (the first item)

------------------------------------------------------------------------
r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines

Yarrow wants entropy estimations to be conservative; the usual idea
is that if you are certain you have N bits of entropy, you declare
N/2.

------------------------------------------------------------------------
r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines

Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the
usual harvest queues. It was a nifty idea, but too heavyweight.

# Submitted by: Arthur Mesh <arthurmesh@gmail.com>

------------------------------------------------------------------------
r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines

Separate out the Software RNG entropy harvesting queue and thread
into its own files.

# Submitted by: Arthur Mesh <arthurmesh@gmail.com>

------------------------------------------------------------------------
r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines

Remove the short-lived namei experiment.

------------------------------------------------------------------------
r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines

Snapshot; Do some running repairs on entropy harvesting. More needs
to follow.

------------------------------------------------------------------------
r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lines

Snapshot of current work;

1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific
or close enough to the Yarrow algorithm. For the rest use a neutral
name.

2) Tidy up headers; put private stuff in private places. More could
be done here.

3) Streamline the hashing/encryption; no need for a 256-bit counter;
128 bits will last for long enough.

There are bits of debug code lying around; these will be removed
at a later stage.

------------------------------------------------------------------------
r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lines

1) example (partially humorous random_adaptor, that I call "EXAMPLE")
* It's not meant to be used in a real system, it's there to show how
the basics of how to create interfaces for random_adaptors. Perhaps
it should belong in a manual page

2) Move probe.c's functionality in to random_adaptors.c
* rename random_ident_hardware() to random_adaptor_choose()

3) Introduce a new way to choose (or select) random_adaptors via tunable
"rngs_want" It's a list of comma separated names of adaptors, ordered
by preferences. I.e.:
rngs_want="yarrow,rdrand"

Such setting would cause yarrow to be preferred to rdrand. If neither of
them are available (or registered), then system will default to
something reasonable (currently yarrow). If yarrow is not present, then
we fall back to the adaptor that's first on the list of registered
adaptors.

4) Introduce a way where RNGs can play a role of entropy source. This is
mostly useful for HW rngs.

The way I envision this is that every HW RNG will use this
functionality by default. Functionality to disable this is also present.
I have an example of how to use this in random_adaptor_example.c (see
modload event, and init function)

5) fix kern.random.adaptors from
kern.random.adaptors: yarrowpanicblock
to
kern.random.adaptors: yarrow,panic,block

6) add kern.random.active_adaptor to indicate currently selected
adaptor:
root@freebsd04:~ # sysctl kern.random.active_adaptor
kern.random.active_adaptor: yarrow

# Submitted by: Arthur Mesh <arthurmesh@gmail.com>

Submitted by: Dag-Erling Smørgrav <des@FreeBSD.org>, Arthur Mesh <arthurmesh@gmail.com>
Reviewed by: des@FreeBSD.org
Approved by: re (delphij)
Approved by: secteam (des,delphij)


/freebsd-10-stable/etc/defaults/rc.conf
/freebsd-10-stable/etc/rc.d/initrandom
/freebsd-10-stable/share/examples/kld/random_adaptor/random_adaptor_example.c
/freebsd-10-stable/share/man/man4/random.4
/freebsd-10-stable/sys/boot/forth/loader.conf
/freebsd-10-stable/sys/conf/NOTES
/freebsd-10-stable/sys/conf/files
/freebsd-10-stable/sys/conf/files.amd64
/freebsd-10-stable/sys/conf/files.i386
/freebsd-10-stable/sys/conf/options
/freebsd-10-stable/sys/dev/glxsb/glxsb.c
/freebsd-10-stable/sys/dev/hifn/hifn7751.c
/freebsd-10-stable/sys/dev/random/dummy_rng.c
/freebsd-10-stable/sys/dev/random/harvest.c
/freebsd-10-stable/sys/dev/random/hash.h
/freebsd-10-stable/sys/dev/random/ivy.c
/freebsd-10-stable/sys/dev/random/live_entropy_sources.c
/freebsd-10-stable/sys/dev/random/live_entropy_sources.h
/freebsd-10-stable/sys/dev/random/nehemiah.c
/freebsd-10-stable/sys/dev/random/pseudo_rng.c
/freebsd-10-stable/sys/dev/random/random_adaptors.c
/freebsd-10-stable/sys/dev/random/random_adaptors.h
/freebsd-10-stable/sys/dev/random/random_harvestq.c
/freebsd-10-stable/sys/dev/random/random_harvestq.h
/freebsd-10-stable/sys/dev/random/randomdev.c
/freebsd-10-stable/sys/dev/random/randomdev.h
/freebsd-10-stable/sys/dev/random/randomdev_soft.c
/freebsd-10-stable/sys/dev/random/randomdev_soft.h
/freebsd-10-stable/sys/dev/random/rwfile.c
/freebsd-10-stable/sys/dev/random/rwfile.h
/freebsd-10-stable/sys/dev/random/yarrow.c
/freebsd-10-stable/sys/dev/random/yarrow.h
/freebsd-10-stable/sys/dev/rndtest/rndtest.c
/freebsd-10-stable/sys/dev/safe/safe.c
/freebsd-10-stable/sys/dev/syscons/scmouse.c
/freebsd-10-stable/sys/dev/syscons/syscons.c
/freebsd-10-stable/sys/dev/ubsec/ubsec.c
/freebsd-10-stable/sys/kern/kern_intr.c
/freebsd-10-stable/sys/kern/subr_bus.c
octeon_rnd.c
/freebsd-10-stable/sys/modules/random/Makefile
/freebsd-10-stable/sys/net/if_ethersubr.c
/freebsd-10-stable/sys/net/if_tun.c
/freebsd-10-stable/sys/netgraph/ng_iface.c
/freebsd-10-stable/sys/sys/random.h
256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255362 07-Sep-2013 markm

Bring in some behind-the-scenes development, mainly By Arthur Mesh,
the rest by me.

o Namespace cleanup; the Yarrow name is now restricted to where it
really applies; this is in anticipation of being augmented or
replaced by Fortuna in the future. Fortuna is mentioned, but behind
#if logic, and is ignorable for now.

o The harvest queue is pulled out into its own modules.

o Entropy harvesting is emproved, both by being made more conservative,
and by separating (a bit!) the sources. Available entropy crumbs are
marginally improved.

o Selection of sources is made clearer. With recent revelations,
this will receive more work in the weeks and months to come.

Submitted by: Arthur Mesh (partly) <arthurmesh@gmail.com>


253539 22-Jul-2013 imp

This file isn't derived from anything delivered by Berkeley, so remove
this statement.


250192 02-May-2013 imp

Use cvmx_mgmt_port_num_ports() instead of the inlined copy of a
previous version of this function.


249919 26-Apr-2013 imp

Octeon 2 (6xxx) and newer CPUs don't use the clock CPU speed for its
I/O clock. Thankfully, the simple executive provies a way to querry
the proper clock that works on all models. Move to asking for the SCLK
via this interface.

This gets the serial console working after we start init and open the
console and set the divisor (which turned the output from good to
bad). I can login on the console now.


249449 13-Apr-2013 dim

Fix undefined behaviour in several gpio_pin_setflags() routines (under
sys/arm and sys/mips), squelching the clang 3.3 warnings about this.

Noticed by: tinderbox and many irate spectators
Submitted by: Luiz Otavio O Souza <loos.br@gmail.com>
PR: kern/177759
MFC after: 3 days


247297 26-Feb-2013 attilio

Merge from vmobj-rwlock branch:
Remove unused inclusion of vm/vm_pager.h and vm/vnode_pager.h.

Sponsored by: EMC / Isilon storage division
Tested by: pho
Reviewed by: alc


243882 05-Dec-2012 glebius

Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags within sys.

Exceptions:

- sys/contrib not touched
- sys/mbuf.h edited manually


243470 24-Nov-2012 jmallett

Use bootverbose to control debug printfs from the Cavium Simple Executive
code. Also remove an unnecessary CVMX_ENABLE_DEBUG_PRINTS conditional around
what is already a cvmx_dprintf.


243469 24-Nov-2012 jmallett

o) Add support for specifying a model of Octeon to target at compile-time,
reducing the number of runtime checks done by the SDK code.
o) Group board/CPU information at early startup by subject matter, so that e.g.
CPU information is adjacent to CPU information and board information is
adjacent to board information.


243264 19-Nov-2012 jmallett

Prevent hang on ATCA-7220 when transmitting packets < 60 bytes.


243263 19-Nov-2012 jmallett

Remove redundant printf of SDK version which already appears earlier in boot.


243255 19-Nov-2012 jmallett

Add basic support for the Radisys-specific PCI console mechanism found on the
Radisys ATCA-7220.


243253 19-Nov-2012 jmallett

o) Do boot descriptor parsing before console setup so that we can use a console
other than UART 0 from the outset.
o) Print board information from sysinfo after consoles have been initialized
rather than doing it during boot descriptor parsing.
o) Use cvmx_safe_printf and platform_reset rather than panic when doing very
early boot descriptor parsing before the console is set up.
o) Get rid of the global octeon_bootinfo.


242955 13-Nov-2012 jmallett

Add preliminary Octeon PCI console support. Radisys-specific PCI console
support may follow soon (it uses a proprietary memory layout, but operation
looks pretty trivial.)


242454 01-Nov-2012 jmallett

Don't disable PCIe just because the host is not a PCI host; the latter flag
only applies to non-PCIe systems. If PCIe is in target mode, it will simply
and gracefully fail to attach of its own accord.


242390 31-Oct-2012 jmallett

Fix longstanding misprint.


242389 31-Oct-2012 jmallett

If the CF physical base is 0, attach no CF devices. This fixes a warning
about a 0 passed to cvmx_phys_to_ptr on systems without a CF interface,
such as the RSYS4GBE.


242346 30-Oct-2012 jmallett

Actually check board type rather than using a specialized octeon_is_simulation
function.


242345 30-Oct-2012 jmallett

Remove oct_read64 and oct_write64 and use their equivalents from the Simple
Executive, which are used everywhere else in the Octeon port. While here,
remove other unused things from octeon_pcmap_regs.h.


242344 30-Oct-2012 jmallett

Remove stale declarations.


242342 30-Oct-2012 jmallett

Speed feature tests and initialize helper configuration that some CPUs require.


242302 29-Oct-2012 jmallett

Add a sysctl to change the LED display.


242276 29-Oct-2012 jmallett

Wrap some long lines and display board serial numbers at boot.


242273 29-Oct-2012 jmallett

Use Simple Executive LED display routines, which correctly use the LED base
address passed from the bootloader, rather than using a hard-coded value.

Make FreeBSD announce itself on the LED display similar to other kernels.

Remove uses of the previous LED routines, which were under-used and only used
in drivers for what seem like debugging purposes, despite those drivers being
widely-tested.

Remove several inlines for accessing memory that duplicate other functions
which are now used instead, as they are now entirely unused.


242201 27-Oct-2012 jmallett

Add missing return that broke 8-bit CF support in refactoring in r222671.
Tested on a Cavium CN5860-EVB-NIC4. This was broken for over a year.


242103 26-Oct-2012 jmallett

Don't attach if the bootloader has not indicated that we're a PCI host. This
fixes booting on systems which are PCI targets.


241082 01-Oct-2012 hselasky

Inherit USB mode from RootHUB port where the USB device is connected.
Only RootHUB ports can be dual mode. Disallow OTG ports on external HUBs.
This simplifies some checks in the USB controller drivers.

MFC after: 1 week


239351 17-Aug-2012 rpaulo

The GPIO drivers were initialising their mutexes with type of
MTX_NETWORK_LOCK. This is wrong since these mutexes have nothing to do
with networking.


237687 28-Jun-2012 imp

octeon_uart_class was removed some time ago everywhere but here.


233644 29-Mar-2012 jmallett

Assume a big-endian default on MIPS and drop the "eb" suffix from MACHINE_ARCH.
This makes our naming scheme more closely match other systems and the
expectations of much third-party software. MIPS builds which are little-endian
should require and exhibit no changes. Big-endian TARGET_ARCHes must be
changed:
From: To:
mipseb mips
mipsn32eb mipsn32
mips64eb mips64

An entry has been added to UPDATING and some foot-shooting protection (complete
with warnings which should become errors in the near future) to the top-level
base system Makefile.


233639 29-Mar-2012 jmallett

Turn on messages from the Simple Executive codebase, what few there are.


233417 24-Mar-2012 gonzo

Remap PMC interrupt for all cores


233336 23-Mar-2012 gonzo

Add pseudo-device for handling PMC interrupts and link everything
PMC-related to build


233331 23-Mar-2012 gonzo

Setup fake MODINFO variables for octeon kernel


233278 21-Mar-2012 jmallett

o) Don't keep drive parameters in a global, put them in the softc.
o) Don't report a bogus stripesize.
o) Eliminate a nearby gratuitous "proxy" indirection.


232816 11-Mar-2012 jmallett

Disable the Simple Executive's error decoding/reporting code.


232812 11-Mar-2012 jmallett

Merge the Cavium Octeon SDK 2.3.0 Simple Executive code and update FreeBSD to
make use of it where possible.

This primarily brings in support for newer hardware, and FreeBSD is not yet
able to support the abundance of IRQs on new hardware and many features in the
Ethernet driver.

Because of the changes to IRQs in the Simple Executive, we have to maintain our
own list of Octeon IRQs now, which probably can be pared-down and be specific
to the CIU interrupt unit soon, and when other interrupt mechanisms are added
they can maintain their own definitions.

Remove unmasking of interrupts from within the UART device now that the
function used is no longer present in the Simple Executive. The unmasking
seems to have been gratuitous as this is more properly handled by the buses
above the UART device, and seems to work on that basis.


232803 11-Mar-2012 jmallett

Fix promiscuous mode with if_octm:
o) The MAC set must occur before the multicast list is set up as the former
will enable the CAM unconditionally, while promiscuous mode disables it,
so if promiscuous mode is to be set this must occur after the MAC is
programmed.
o) The multicast list must be set up unconditionally as even if flags have
not changed, if the interface has gone through a reinitialization, the
state of the CAM as changed by the MAC initialization could be incorrect.
o) Call octm_init when flags change, even if the interface is already running.


232410 02-Mar-2012 jmallett

When creating a handle for a subregion, be sure to actually math out the new
handle address, where we're using handles as raw addresses.

This fixes devices with subregions on Octeon PCI specifically, and likely also on
MIPS more generally, where there isn't another bus_space in use that was doing the
math already.


232402 02-Mar-2012 jmallett

Unbreak SMP on stock Octeon systems -- copy the core_mask from bootinfo into
sysinfo. This should have been done as part of replacing bootinfo with sysinfo.


232289 29-Feb-2012 gonzo

Revert part of old logic of assigning MAC addressess:

- Reserver respective number of addresses for managment port
- octm uses base address directly
- other drivers get MACs on "first come first served" basis

Reviewed by: juli


231987 22-Feb-2012 gonzo

Refctor address assignment for Octeon's ethernet ports:

- Centralize address assignment
- Make sure managment ports get first MAC address in pool
- Properly propagate fail if address allocation failed

Submitted by: Andrew Duane <aduane@juniper.net>


230405 20-Jan-2012 gonzo

We use port_index field of struct octusb_qh to reference USB state
of root HUB. Although it is initialized with port index of the
device's parent hub, which is worng. So track the USB tree up to
root HUB and initialize this filed ptroprly

Rename port_index to root_port_index in order to reflect its
real semantics.


229677 06-Jan-2012 gonzo

- Add better COP2 (crypto coprocessor) context handler for Octeon. Keep
COP2 disabled and lazily allocate COP2 context structure in exception
handler. Keep kernel and userland contexts separated.


229408 03-Jan-2012 gonzo

- Octeon-SDK strictly requires multi_count to be zero for
full and low speed devices.


229168 01-Jan-2012 gonzo

- Properly set IRQ handlers for all USB ports


229161 31-Dec-2011 gonzo

- struct clocktime sets different ranges for DOW and month
comparing to struct timeval. for clocktime they should be
1..7 and 1..12 respectively

- CAPK-0100ND uses RTC without centruy bit (DS1307) so set it 21st


229072 31-Dec-2011 gonzo

- Pass proper endpoint number (without direction flag) to
cvmx_usb_open_pipe


228925 28-Dec-2011 gonzo

- Add generic GPIO driver for Cavium Octeon. At the moment pin definition is
hardcoded but will be changed later with more flexible way to define them.


228872 24-Dec-2011 gonzo

- Initialize compact_flash_attribute_base_addr from bootinfo structure


228853 23-Dec-2011 gonzo

- Set CF physical address base in sysinfo structure


228640 17-Dec-2011 bz

Unbreak the OCTEON1 kernel build after r228483 removing the left over
declaration.

MFC after: 11 days


228483 14-Dec-2011 hselasky

Implement better support for USB controller suspend and resume.

This patch should remove the need for kldunload of USB
controller drivers at suspend and kldload of USB controller
drivers at resume.

This patch also fixes some build issues in avr32dci.c

MFC after: 2 weeks


228088 28-Nov-2011 gonzo

- Copy base MAC address from bootinfo descriptor to sysinfo struct

Reviewed by: Andrew Duane


227849 22-Nov-2011 hselasky

Rename device_delete_all_children() into device_delete_children().

Suggested by: jhb @ and marius @
MFC after: 1 week


227843 22-Nov-2011 marius

- There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
(bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
since r52045) but even recently added device drivers do this unnecessarily.
Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
Discussed with: jhb
- Also while at it, use __FBSDID.


227309 07-Nov-2011 ed

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


226025 04-Oct-2011 marcel

Add default address for FLASH mapping on the boot bus.

Reviewed by: jmallett, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane


226024 04-Oct-2011 marcel

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


226020 04-Oct-2011 marcel

o Clean up some ID printfs, and put under bootverbose
o Remove redundant lookups of base address in cf_identify
o Fix some indenting issues
o Fix an identification bug that uses DRQ to checlk for ident block
returned. The correct spec is to look for BSY to be cleared.

Reviewed by: imp, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane


226018 04-Oct-2011 marcel

Partially revert r224661:
octeon_ap_boot is not a bitmask. It holds the CPU Id of the
AP currently being started. As such there's no need to make
it a 64-bit integral and we're not limited to 64 CPUs.

Reported by: jmallet
Obtained from: Andre Duane


224661 05-Aug-2011 marcel

Make octeon_ap_boot 64 bits to handle MAXCPU up to 64.
Better construction of CPU mask in platform_cpu_mask().
Release cores still in reset when platform_start_ap() is called.

Reviewed by: imp, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane
Approved by: re (kib)


222813 07-Jun-2011 attilio

etire the cpumask_t type and replace it with cpuset_t usage.

This is intended to fix the bug where cpu mask objects are
capped to 32. MAXCPU, then, can now arbitrarely bumped to whatever
value. Anyway, as long as several structures in the kernel are
statically allocated and sized as MAXCPU, it is suggested to keep it
as low as possible for the time being.

Technical notes on this commit itself:
- More functions to handle with cpuset_t objects are introduced.
The most notable are cpusetobj_ffs() (which calculates a ffs(3)
for a cpuset_t object), cpusetobj_strprint() (which prepares a string
representing a cpuset_t object) and cpusetobj_strscan() (which
creates a valid cpuset_t starting from a string representation).
- pc_cpumask and pc_other_cpus are target to be removed soon.
With the moving from cpumask_t to cpuset_t they are now inefficient
and not really useful. Anyway, for the time being, please note that
access to pcpu datas is protected by sched_pin() in order to avoid
migrating the CPU while reading more than one (possible) word
- Please note that size of cpuset_t objects may differ between kernel
and userland. While this is not directly related to the patch itself,
it is good to understand that concept and possibly use the patch
as a reference on how to deal with cpuset_t objects in userland, when
accessing kernland members.
- KTR_CPUMASK is changed and now is represented through a string, to be
set as the example reported in NOTES.

Please additively note that no MAXCPU is bumped in this patch, but
private testing has been done until to MAXCPU=128 on a real 8x8x2(htt)
machine (amd64).

Please note that the FreeBSD version is not yet bumped because of
the upcoming pcpu changes. However, note that this patch is not
targeted for MFC.

People to thank for the time spent on this patch:
- sbruno, pluknet and Nicholas Esborn (nick AT desert DOT net) tested
several revision of the patches and really helped in improving
stability of this work.
- marius fixed several bugs in the sparc64 implementation and reviewed
patches related to ktr.
- jeff and jhb discussed the basic approach followed.
- kib and marcel made targeted review on some specific part of the
patch.
- marius, art, nwhitehorn and andreast reviewed MD specific part of
the patch.
- marius, andreast, gonzo, nwhitehorn and jceel tested MD specific
implementations of the patch.
- Other people have made contributions on other patches that have been
already committed and have been listed separately.

Companies that should be mentioned for having participated at several
degrees:
- Yahoo! for having offered the machines used for testing on big
count of CPUs.
- The FreeBSD Foundation for having sponsored my devsummit attendance,
which has been instrumental.
- Sandvine for having offered offices and infrastructure during
development.

(I really hope I didn't forget anyone, if it happened I apologize in
advance).


222671 04-Jun-2011 imp

Add support for True IDE mode to the Octeon CF driver. This mode is
signalled when the attribute address for the CF is 0 in the octeon
sysinfo structure. In this mode, the DATA port is 16-bits, but the
other ports are 8-bits, but on a 16-bit bus (so you have to access it
a short at a time, but only believe the lower byte). See the code for
more details on this slightly odd arrangement. I'm still not 100%
happy with the abstractions here on many levels (starting with the
globals for these settings, on down to no bus_space use, etc), but the
driver had these problems before the change.

Also, clean up the code a bit to make this support easier, and the
code a bit easier to read. I tried to follow existing style, but may
have missed a few spots. Add some comments.

Fix probe/attach routine to return a proper error for the simulator.

With this change, my EBH5200 eval board now recognizes the CF well
enough to boot to the login prompt. Before it would say it never
became ready. My CN3010-EVB-HS5 still boots properly. My older
CN3860-based board won't load the 64-bit kernel, either before or
after the change, and I didn't chase that down.


221407 03-May-2011 marius

- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP
(reporting IFM_LOOP based on BMCR_LOOP is left in place though as
it might provide useful for debugging). For most mii(4) drivers it
was unclear whether the PHYs driven by them actually support
loopback or not. Moreover, typically loopback mode also needs to
be activated on the MAC, which none of the Ethernet drivers using
mii(4) implements. Given that loopback media has no real use (and
obviously hardly had a chance to actually work) besides for driver
development (which just loopback mode should be sufficient for
though, i.e one doesn't necessary need support for loopback media)
support for it is just dropped as both NetBSD and OpenBSD already
did quite some time ago.
- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Restructure the PHY entry points to use a structure of entry points
instead of discrete function pointers, and extend this to include
a "reset" entry point. Make sure any PHY-specific reset routine is
always used, and provide one for lxtphy(4) which disables MII
interrupts (as is done for a few other PHYs we have drivers for).
This includes changing NIC drivers which previously just called the
generic mii_phy_reset() to now actually call the PHY-specific reset
routine, which might be crucial in some cases. While at it, the
redundant checks in these NIC drivers for mii->mii_instance not being
zero before calling the reset routines were removed because as soon
as one PHY driver attaches mii->mii_instance is incremented and we
hardly can end up in their media change callbacks etc if no PHY driver
has attached as mii_attach() would have failed in that case and not
attach a miibus(4) instance.
Consequently, NIC drivers now no longer should call mii_phy_reset()
directly, so it was removed from EXPORT_SYMS.
- Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe().
The purpose of that function is to perform the common steps to attach
a PHY driver instance and to hook it up to the miibus(4) instance and to
optionally also handle the probing, addition and initialization of the
supported media. So all a PHY driver without any special requirements
has to do in its bus attach method is to call mii_phy_dev_attach()
along with PHY-specific MIIF_* flags, a pointer to its PHY functions
and the add_media set to one. All PHY drivers were updated to take
advantage of mii_phy_dev_attach() as appropriate. Along with these
changes the capability mask was added to the mii_softc structure so
PHY drivers taking advantage of mii_phy_dev_attach() but still
handling media on their own do not need to fiddle with the MII attach
arguments anyway.
- Keep track of the PHY offset in the mii_softc structure. This is done
for compatibility with NetBSD/OpenBSD.
- Keep track of the PHY's OUI, model and revision in the mii_softc
structure. Several PHY drivers require this information also after
attaching and previously had to wrap their own softc around mii_softc.
NetBSD/OpenBSD also keep track of the model and revision on their
mii_softc structure. All PHY drivers were updated to take advantage
as appropriate.
- Convert the mebers of the MII data structure to unsigned where
appropriate. This is partly inspired by NetBSD/OpenBSD.
- According to IEEE 802.3-2002 the bits actually have to be reversed
when mapping an OUI to the MII ID registers. All PHY drivers and
miidevs where changed as necessary. Actually this now again allows to
largely share miidevs with NetBSD, which fixed this problem already
9 years ago. Consequently miidevs was synced as far as possible.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
weren't explicitly converted to support flow control before. It's
unclear whether flow control actually works with these but typically
it should and their net behavior should be more correct with these
changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from: NetBSD (partially)
Reviewed by: yongari (earlier version), silence on arch@ and net@


219706 16-Mar-2011 jmallett

o) Set MAC addresses starting at the MAC base for all management ports, not
just the MR-730.
o) Start MAC addresses for the non-management ports after the management ports.

Submitted by: Bhanu Prakash (with modifications)


219695 16-Mar-2011 jmallett

o) Tear down receive interrupt on detach.

Submitted by: Bhanu Prakash


219694 16-Mar-2011 jmallett

o) Clean up FPA pools on module unload.
o) Allocate output buffer pool based on available output queues.

Submitted by: Bhanu Prakash (with modifications)


218594 12-Feb-2011 jmallett

The Lanner MR-730 uses the first two MACs at its MAC base for the 10/100
management ports, and gigabit ports start at an offset of 2 from the MAC
base.


218591 12-Feb-2011 jmallett

Allow the platform code to return a bitmask of running cores rather than just
a number of cores, this allows for a sparse set of CPUs. Implement support
for sparse core masks on Octeon.

XXX jeff@ suggests that all_cpus should include cores that are offline or
running other applications/OSes, so the platform API should be further
extended to allow us to set all_cpus to include all cores that are
physically-present as opposed to only those that are running FreeBSD.

Submitted by: Bhanu Prakash (with modifications)
Reviewed by: jchandra
Glanced at by: kib, jeff, jhb


217665 20-Jan-2011 jmallett

If there is no WQE available for a packet that needs segmentation, drop it
and return.


217664 20-Jan-2011 jmallett

Remove some compile-time options from the driver, particularly async IOBDMA
support which is unused on FreeBSD and which complicates working on the
code now, can easily be added back later by someone determined to use it.


217620 20-Jan-2011 gonzo

Fix build by changing format for size_t to %jd


217573 19-Jan-2011 jmallett

Don't do a device_identify to add uart0, it's already hinted.

Reported by: imp


217518 17-Jan-2011 imp

Save the CPU model, the board and the CPU clock rate so they are reported by
the approrpiate sysctl.


217265 11-Jan-2011 jhb

Remove unneeded includes of <sys/linker_set.h>. Other headers that use
it internally contain nested includes.

Reviewed by: bde


217254 11-Jan-2011 jmallett

Initialize PCIe buses and add preliminary support for 64-bit BARs.


217244 10-Jan-2011 jmallett

Count output bytes and packets.


217243 10-Jan-2011 jmallett

Shorten device name so it fits into vmstat -i.


217222 10-Jan-2011 jmallett

o) Free mbufs in error cases.
o) Clear/acknowledge receive interrupt at end of thread. This gives the
management interfaces performance on the order of 100Mbps rather than
the previous level of 10Mbps on my MR-730.


217214 10-Jan-2011 jmallett

o) Expand the CIU driver to be aware of newly-allocated parts of the IRQ range.
o) Add 'octm', a trivial driver for the 10/100 management ports found on some
Octeon systems.
o) Make the Simple Executive's management port helper routines compile on
FreeBSD (namely by not doing math on void pointers.)
o) Add a cvmx_mgmt_port_sendm routine to the Simple Executive to send an mbuf
so there is only one copy in the transmit path, rather than having to first
copy the mbuf to an intermediate buffer and then copy that to the Simple
Executive's transmit ring.
o) Properly work out MII addresses of management ports on the Lanner MR-730.
XXX The MR-730 also needs some patches to the MII read/write routines, but
this is sufficient for now. Media detection will be fixed in the future
when I can spend more time reading the vendor-supplied patches.


217212 09-Jan-2011 jmallett

Now that we correctly enable rx interrupts on all cores, performance has gotten
quite awful, because e.g. 4 packets will come in and get processed on 4
different cores at the same time, really battling with the TCP stack quite
painfully. For now, just run one task at a time.

This gets performance up in most cases to where it was before the correctness
fixes that got interrupts to run on all cores (except in high-load TCP transmit
cases where all we're handling receive for is ACKs) and in some cases it's
better now. What would be ideal would be to use a more advanced interrupt
mitigation strategy and possibly to use different workqueue groups per port for
multi-port systems, and so on, but this is a fine stopgap.


217210 09-Jan-2011 jmallett

o) Remove some unused local definitions of IP protocol numbers.
o) Use CPU_FOREACH rather than a miscrafted for loop with an off-by-one to
enable workq interrupts on all cores.


216947 04-Jan-2011 jmallett

o) Add MIPS_COP_0_EXC_PC accessors to <machine/cpufunc.h>.
o) Make the octeon_wdog driver work on multi-CPU systems and to also print more
information on NMI that may aid debugging. Simplify and clean up internal
API and structure.


216946 04-Jan-2011 jmallett

o) Unmask Central Interrupt Unit interrupts on APs, too.
o) There's no good reason to make the low bits of the ebase the core
number. While per-CPU exception bases would be nice, for now we just
need to make ebase the same on all cores.


216773 28-Dec-2010 jmallett

When allocating memory from bootmem for the kernel to use, try to leave about
2MB of memory in the bootmem allocator for the SDK to use internally at a later
point. It'd be nice if there were some functions we could call before
allocating memory to let various facilities reserve some memory, but for now
this seems sufficient. Previously some unfortunate systems could give up all
(or at least most) of their memory to the kernel from bootmem, and then
allocating command queues for packet output and the like would fail later in
the boot process (which in turn would lead to crashes even later.)

Reported by: kan


216476 16-Dec-2010 jmallett

o) Add support for the Lanner MR-321X/MR-325, which is just a modified MR-320.
o) On the Lanner MR-730, disable PCIe lane swap, per vendor.


216320 09-Dec-2010 gonzo

- dump_avail layout should be sequence of [start, end)
pairs, not <start, size>.

Spotted by: alc@


216318 09-Dec-2010 gonzo

- Populate dump_avail with proper values from phys_avail


216092 01-Dec-2010 jmallett

Add interrupt describing and binding to CIU.


216071 30-Nov-2010 jmallett

Run all poll requests through a single function that can either do the generic
link state polling or media-specific ones, while avoidiing changing link state
on interfaces that use miibus; this substantially speeds up link time on
interface (re)initialization.


216069 30-Nov-2010 jmallett

Display some Octeon 2 features and a feature for distinguishing between PCIe
implementations.


216064 29-Nov-2010 jmallett

Don't free the work queue entry that we're using to hold the scatter-gather
list on exit from the transmit path. The scatter-gather list itself can be
asynchronously DMAed to the transmit hardware, and we could actually lock up
the transmitter if any of a number of races around this were lost.

Instead, let the PKO free the scatter-gather list when it is done with it, and
use the "i" bit in each segment of the packet to avoid having them go into the
FPA.

This fixes an unrecoverable transmit stall under transmit load.

MFC after: 3 days


215990 28-Nov-2010 jmallett

Merge Cavium Octeon SDK 2.0 Simple Executive; this brings some fixes and new
facilities as well as support for the Octeon 2 family of SoCs.

XXX Note that with our antediluvian assembler, we can't support some Octeon 2
instructions and fall back to using the old ones instead.


215989 28-Nov-2010 gonzo

- Add watchdog driver for Cavium Octeon. At the moment only
UP systems are supported.


215974 28-Nov-2010 jmallett

o) Remove some commented out or unimplemented code.
o) Remove some options that are configurable on Linux but not FreeBSD.
o) Centralize open/poll/stop routines for XAUI and SGMII and use the common
uninit routine directly rather than providing a wrapper for it. The init
functions for these interfaces are now identical and the common init routine
could merge in setting those function pointers except that some hardware
seems to use no open/poll/stop method?


215959 28-Nov-2010 jmallett

Remove unused and broken code to implement POW send and POW-only devices; a
separate POW driver makes more sense, generally.


215957 27-Nov-2010 jmallett

Use if_transmit to avoid ifq locking in transmit path.


215270 13-Nov-2010 imp

Remove the 'machine mips' from DEFAULTS. Put the proper 'machine mips
mipsel' or 'machine mips mipseb' into the config file (with a few 64's
tossed in for good measure). This will let us build the proper
kernels with different worlds as part of make universe.


214766 03-Nov-2010 jmallett

Don't attach the PCI bus driver if the board we're being run on has PCIe. The
two are mutually-exclusive on Octeon.


214708 02-Nov-2010 jmallett

Declare the CF GEOM class so that g_modevent will get called, the class will
be recorded, etc. This fixes libgeom on Octeon.


213893 15-Oct-2010 marius

Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 to get rid of certain hacks. For
the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
addresses; we now let mii_attach() only probe the PHY at the desired
address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
off from, partly even based on grabbing and using the softc of the
parent; we now pass these flags down from the NIC to the PHY drivers
via mii_attach(). This got us rid of all such hacks except those of
brgphy() in combination with bce(4) and bge(4), which is way beyond
what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

Reviewed by: jhb, yongari


213807 13-Oct-2010 jmallett

Keep polling at 50hz as long as link state is changing.


213762 13-Oct-2010 jmallett

o) Make it possible to attach a PHY directly to an octe device rather than
using miibus, since for some devices that use multiple addresses on the bus,
going through miibus may be unclear, and for devices that are not standard
MII PHYs, miibus may throw a fit, necessitating complicated interfaces to
fake the interface that it expects during probe/attach.
o) Make the mv88e61xx SMI interface in octe attach a PHY directly and fix some
mistakes in the code that resulted from trying too hard to present a nice
interface to miibus.
o) Add a PHY driver for the mv88e61xx. If attached (it is optional in kernel
compiles so the default behavior of having a dumb switch is preserved) it
will place the switch in a VLAN-tagging mode such that each physical port
has a VLAN associated with it and interfaces for the VLANs can be created to
address or bridge between them.
XXX It would be nice for this to be part of a single module including the
SMI interface, and for it to fit into a generic switch configuration
framework and for it to use DSA rather than VLANs, but this is a start
and gives some sense of the parameters of such frameworks that are not
currently present in FreeBSD. In lieu of a switch configuration
interface, per-port media status and VLAN settings are in a sysctl tree.
XXX There may be some minor nits remaining in the handling of broadcast,
multicast and unknown destination traffic. It would also be nice to go
through and replace the few remaining magic numbers with macros at some
point in the future.
XXX This has only been tested with the MV88E6161, but it should work with
minimal or no modification on related switches, so support for probing
them was included.

Thanks to Pat Saavedra of TELoIP and Rafal Jaworowski of Semihalf for their
assistance in understanding the switch chipset.


213346 02-Oct-2010 jmallett

o) Allow devices to override the MDIO read and write functions presented to
the miibus attached to octe interfaces.
o) Add an SMI/MDIO interface to the MV88E61XX and use it for the switch PHY on
the Lanner MR-320. An actual driver for the switch PHY will come later.
Note that for now it intercepts and fakes MII_BMSR reads to prevent the
miibus from talking to anything but the switch itself.


213345 02-Oct-2010 jmallett

Rather than shifting offsets by three, set register offset to 3. All our
bus interface does that's special here now is to use a 64-bit register size.
In theory, uart(4) ought to support a regsz as well as regshft and support
64-bit registers directly.

Also use the UART class's range rather than a hand-coded 1024 for the address
range.


213341 02-Oct-2010 jmallett

Remove extra cpu setting and commented-out devices, some of which don't exist.


213230 27-Sep-2010 jmallett

Give devices lots of time to settle around programming BARs and command
registers. Without this, the settings do not seem to stick for Atheros NICs in
the PCI slot of the Lanner MR-320.


213228 27-Sep-2010 jmallett

o) Program the Lanner MR-320 for 32-bit mode, too.
o) Give a virtual address for I/O ports on n64.
o) On the Portwell CAM-0100, return the right IRQ for the on-board SATA.
o) Except on bridges, only set PORTEN and MEMEN on devices that have I/O or
memory BARs respectively.
o) Disable PORTEN and MEMEN while reprogramming BARs.
o) On the Lanner MR-955, set the Tx DMA power register for the on-board Promise
SATA controller.


213156 25-Sep-2010 jmallett

o) Send mbufs to BPF listeners from within cvm_oct_xmit().
o) Pin receive threads when they're running since we do access some core-local
resources.


213150 25-Sep-2010 jmallett

Handle link updates in a task.


213140 24-Sep-2010 jmallett

Make the vast majority of Simple Executive files standard. Perhaps some of
these could be made dependent on either of the octusb or octe options, but
making them standard fixes a number of option combinations that were previously
broken.


213090 24-Sep-2010 jmallett

o) Add bus_teardown_intr for pci and ciu. This allows the Promise SATA
driver to try to switch interrupt handlers at setup. It's not a very
good implementation of bus_teardown_intr, though.
o) Set cache line size and latency timers for PCI devices per Linux.


213089 24-Sep-2010 jmallett

Flesh out PCI bus support some:
o) Reset and configure the bus from scratch rather than expecting U-Boot to
do it for us. Values and configuration from Linux, U-Boot and comments
in the Cavium Simple Executive sources.
o) Do a resource assignment and bus numbering pass in the absence of a PCI
BIOS or firmware that will do it for us.
XXX This has to be the third or fourth instance of this in FreeBSD and
it would be nice to have it become part of the PCI bus driver itself,
like it is on Linux.
o) Fix interrupt mapping for and adjust bus configuration for the Lanner
MR-955, based on information provided by Lanner.


212843 19-Sep-2010 jmallett

Fix to specify generic bus_add_child.


212842 19-Sep-2010 jmallett

Don't use memory that can't be direct-mapped on !n64.


212809 18-Sep-2010 jmallett

Fix octusb build.


212632 15-Sep-2010 neel

Make the meaning of the 'mask' argument to 'set_intr_mask(mask)' consistent
with the meaning of IM bits in the status register.

Reviewed by: jmallett, jchandra


210312 20-Jul-2010 jmallett

o) Add the "octusb" controller which supports the first port of the Octeon
on-board USB controller. It is not currently enabled because there are
known problems with device communication and until those are fixed I am not
certain that it won't destabilize the system. [1]
o) Add the "cryptocteon" opencrypto device based on the OCF device written by
David McCullough. It is not currently enabled because until support for
saving/restoring coprocessor 2 state on context switch is available, it runs
with interrupts disabled, which tends to pessimize performance over using a
software crypto facility. Tests using this driver which are not negatively
affected by it running with interrupts disabled show it to be substantially
faster than software for large blocks.

Submitted by: hps [1]


210311 20-Jul-2010 jmallett

Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive
library:
o) Increase inline unit / large function growth limits for MIPS to accommodate
the needs of the Simple Executive, which uses a shocking amount of inlining.
o) Remove TARGET_OCTEON and use CPU_CNMIPS to do things required by cnMIPS and
the Octeon SoC.
o) Add OCTEON_VENDOR_LANNER to use Lanner's allocation of vendor-specific
board numbers, specifically to support the MR320.
o) Add OCTEON_BOARD_CAPK_0100ND to hard-wire configuration for the CAPK-0100nd,
which improperly uses an evaluation board's board number and breaks board
detection at runtime. This board is sold by Portwell as the CAM-0100.
o) Add support for the RTC available on some Octeon boards.
o) Add support for the Octeon PCI bus. Note that rman_[sg]et_virtual for IO
ports can not work unless building for n64.
o) Clean up the CompactFlash driver to use Simple Executive macros and
structures where possible (it would be advisable to use the Simple Executive
API to set the PIO mode, too, but that is not done presently.) Also use
structures from FreeBSD's ATA layer rather than structures copied from
Linux.
o) Print available Octeon SoC features on boot.
o) Add support for the Octeon timecounter.
o) Use the Simple Executive's routines rather than local copies for doing reads
and writes to 64-bit addresses and use its macros for various device
addresses rather than using local copies.
o) Rename octeon_board_real to octeon_is_simulation to reduce differences with
Cavium-provided code originally written for Linux. Also make it use the
same simplified test that the Simple Executive and Linux both use rather
than our complex one.
o) Add support for the Octeon CIU, which is the main interrupt unit, as a bus
to use normal interrupt allocation and setup routines.
o) Use the Simple Executive's bootmem facility to allocate physical memory for
the kernel, rather than assuming we know which addresses we can steal.
NB: This may reduce the amount of RAM the kernel reports you as having if
you are leaving large temporary allocations made by U-Boot allocated
when starting FreeBSD.
o) Add a port of the Cavium-provided Ethernet driver for Linux. This changes
Ethernet interface naming from rgmxN to octeN. The new driver has vast
improvements over the old one, both in performance and functionality, but
does still have some features which have not been ported entirely and there
may be unimplemented code that can be hit in everyday use. I will make
every effort to correct those as they are reported.
o) Support loading the kernel on non-contiguous cores.
o) Add very conservative support for harvesting randomness from the Octeon
random number device.
o) Turn SMP on by default.
o) Clean up the style of the Octeon kernel configurations a little and make
them compile with -march=octeon.
o) Add support for the Lanner MR320 and the CAPK-0100nd to the Simple
Executive.
o) Modify the Simple Executive to build on FreeBSD and to build without
executive-config.h or cvmx-config.h. In the future we may want to
revert part of these changes and supply executive-config.h and
cvmx-config.h and access to the options contained in those files via
kernel configuration files.
o) Modify the Simple Executive USB routines to support getting and setting
of the USB PID.


207533 02-May-2010 marius

Remove redundant checking of sc_leaving (uart_intr() already handles this).

Approved by: marcel


206829 19-Apr-2010 jmallett

o) Fix XKPHYS physical address extraction. Also define cache coherency
attributes for XKPHYS.
o) Make coprocessor 0 accessor function macros for register+selector registers
take the full name so that e.g. (as done in this commit), prid selector 1
can be written through mips_wr_ebase() rather than mips_wr_prid1().
o) Allow for sign extension of 32-bit segment addresses.
o) Remove an unused MIPS-I register number.


206721 17-Apr-2010 jmallett

o) Add SMP support for Octeon using U-Boot to launch all the processors at the
same time.
o) Remove some unused trivial uart functions from octeon_machdep now that the
uart part is fully working and they are unused.
o) Use __func__ instead of __FUNCTION__.
o) Use intr_*() instead of other routines that do the same thing.
o) Remove some duplicate printfs from the Octeon port, as well as duplicate
setting of Maxmem.
o) Use the right frequency divider on Octeon.
o) Use PCPU_GET(cpuid) consistently to get the cpuid of the running core.
o) Remove some unused macros in the Octeon port.
o) Use mips_sync() around use of the global dpcpu, whose value may not be
visible to APs at first.
o) When loading the first thread's stack, use macros to make the code correct
for n64 as well.
o) Remove stub, do-nothing FAU init/enable/disable functions from the RGMX
driver.


205115 13-Mar-2010 jmallett

o) Use octeon_fpa_alloc_phys in a situation in which we don't need a usable
pointer, rather than octeon_fpa_alloc.
o) Report half duplex status properly.
o) Do not unconditionally update the last known link status in the softc. If
report_link isn't set, when octeon_rgmx_config_speed is called the first
time it will tell the driver (essentially) that we have already marked the
interface up. Likewise, don't change media speed and duplex if only the
link status is at issue. [1]
o) Remove manual changing of link state and let octeon_rgmx_config_speed do the
heavy lifting. [1]

Reviewed by: [1] imp
Sponsored by: Packet Forensics


205061 12-Mar-2010 jmallett

o) Send packets being queued for transmission up to BPF if there's a listener.
o) Properly configure the CAM to handle IFF_PROMISC and note where IFF_ALLMULTI
handling would go if we didn't already force the NIC to receive all
multicast traffic.

Reviewed by: imp
Sponsored by: Packet Forensics


205048 11-Mar-2010 jmallett

Don't force single user on Octeon anymore.


205047 11-Mar-2010 jmallett

o) Eliminate use of sc->typestr, which is always NULL.
o) Inline octeon_rgmx_mark_ready into octeon_rgmx_init.
o) Add a media status handler that reports link and media status.
o) Set link state when if_init is called.
o) Remove some printfs related to driver state changes.
o) Remove some gratuitous comments.

Reviewed by: imp
Sponsored by: Packet Forensics


204789 06-Mar-2010 jmallett

Check for device faults and for failures to set DRQ when expected, rather
than spinning forever. This fixes booting with CF ejected.

NB: I've made the driver pretty chatty about errors in case there's hardware
that operates differently to mine, so we can easily track down any issues.

Reviewed by: imp
Sponsored by: Packet Forensics


204778 05-Mar-2010 jmallett

o) Simplify the implementation of bus read/write functions, and eliminate some
redundant implementations.
o) Use ABI, not ISA, to determine address length.
o) Disable and restore interrupts around any operation that uses all 64 bits of
a register. In kernels using the O32 ABI, the upper 32 bits of those
registers is likely to be corrupted by an interrupt.

Sponsored by: Packet Forensics


204777 05-Mar-2010 jmallett

Properly detect a type of real board that claims to have a 0.0 revision.
This fixes at least memory detection on that board.

Sponsored by: Packet Forensics


204776 05-Mar-2010 jmallett

Do not mask off the low byte of the chipid, it makes some of the case
statements unreachable and seems to be wrong. Fixes detection of the number
of ports available on some models.

Sponsored by: Packet Forensics


204055 18-Feb-2010 imp

Make printfs work for both OCTEON1 and OCTEON1-32


204054 18-Feb-2010 imp

Parens around tertiary operator so that casting the result works...


203940 16-Feb-2010 gonzo

- Clean-up output of memory banks info


203130 28-Jan-2010 imp

Add Cavium's standard copyright to those files that are currently
lacking a copyright/license statement. All these files were in the
Cavium FreeBSD source drop and appear to be written by Cavium (some
are nearly verbatim copies of files from the cnusers' 1.9.0 SDK, which
also uses this copyright).


203129 28-Jan-2010 imp

We make it to single user well, but not so well to multi-user. Force
single user for the moment since that's a better experience for people
trying this code out...


203128 28-Jan-2010 imp

trim unused members of the softc.


202997 26-Jan-2010 imp

Doh. Remove extra pcpu initialization that I thought was needed, but
isn't needed since we moved all that into mips_pcpu0_init.


202985 25-Jan-2010 imp

Export knowledge of the special bus space we use for the console to
obio. Take advantage of the fact that obio only really supports uart
at the moment to use the uart bus tag always for IOPORT allocations.

# this needs to be redone to conform to FreeBSD standards and allow for
# additional drivers for SoC hardware to attach


202984 25-Jan-2010 imp

Turn on debugging on the fpa unit. Fix some printfs that were only
enabled for debugging. This should be turned off before we release,
but we need it for the moment.


202939 24-Jan-2010 imp

o Write the soft reset bit in the cavium core to reset. [1]
o panic if the board boot descriptor is too old...

Obtained from: [1] looking at the cavium sdk's executive code


202867 23-Jan-2010 imp

Eliminate octeonregs.h. It was a copy of maltaregs.h with
s/malta/octeon/gi done...


202850 23-Jan-2010 imp

Migrate from old "DDB" style debugger to newer KDB style.


202834 22-Jan-2010 imp

Declare octeon_get_clock_rate, now exported from octeon_machdep


202831 22-Jan-2010 imp

o Add support for memory above 256MB on the octeon.
o Force the ebase to be 0x80000000 (the base that we're booted with may
need to be respected in the future).
o Initialize the clock early so we can initialize the console early
o use panic where we can now use it.
o Tag some code for parsing the boot records as belonging in the cavium sdk.
o remove support for booting on ancient boards...

# we make it further in bootstrapping now: interrupts being enabled in the
# uarts are now taking us out, it seems, for reasons unknown.


202786 22-Jan-2010 imp

Don't clear bss/sbss. The boot loader already does this. In addition,
the Cavium version of the boot loader puts data just after &end, so
our rounding up to the next page in clearing memory overwrote their
data, which meant we'd get a lot of wrong values for parameters to the
system.

While I'm here, remove argc/argv parsing. Those values aren't passed
in via a0 and a1, so it was a guaranted panic on some boards.


202785 22-Jan-2010 imp

Jump to the mips reset vector. OR in the 0x80000000 for kseg0 and
cast it to a long so it will work on 64-bit targets.

reset now works on octeon, so I don't have to power cycle the board as
often.


202175 12-Jan-2010 imp

Set the svn:eol-style = native and svn:mime-type = text/plain
properties on all files in this tree.

Submitted by: rpaulo@


202105 11-Jan-2010 imp

Using svn cp rather than cp to copy these files over had the benefit
of preserving their history. It had the problem that it also copied
over mergeinfo data. Since we're retiring the projects/mips branch,
I'm removing the svn:mergeinfo property from them all.

Submitted by: jhb


202063 11-Jan-2010 imp

Cope with the move and if_timer going way.


201921 09-Jan-2010 imp

Merge from projects/mips to head by hand:

Copy the support files for the Octeon 1 CPU from sys/mips/octeon1 on
the projects/mips side to sys/mips/cavium on the head side to conform
to the other vendor code. This code was contributed by Cavium to the
project and forward ported by Warner Losh, with some additional code
from Randal Stewart.

# I'll fix the building problems the move creates in a future commit.


201881 09-Jan-2010 imp

Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the
BSP. Provide a missing prototype.


201845 08-Jan-2010 imp

Centralize initialization of pcpu, and set curthread early...


201659 06-Jan-2010 imp

Sync to r201658 on head.


201629 06-Jan-2010 imp

Merge from head at r201628.

# This hasn't been tested, and there are at least three bad commits
# that need to be backed out before the branch will be stable again.


201530 04-Jan-2010 imp

Style(9) pass.


200344 10-Dec-2009 imp

Hook up parsing of the boot records.


199759 24-Nov-2009 imp

kill stray printf


199740 24-Nov-2009 imp

remove bogus panic.
Don't use fortran style line control.


199738 24-Nov-2009 imp

Rewrite to try to be more sane:
o Introduce a uart bus space so that we don't have to hack dev/uart to do 8
byte reads. This also handles the shift properly, so reset the shift we
want dev/uart doing to 0. In effect, this bus space makes the octeon
registers have an interface to dev/uart that looks just like the old ISA
bus, but does the necessary 64-bit read/write to the bus. We only support
read/write operations. We do all the widths, but likely could get away
with only 64-bit and 8-bit given the restricted nature of use of this bus.
o use bus_space_map to set the .bsh rather than a direct assignment.
o Minor cleanup of uart_cpu_getdev to make it conform more to the other
implementations.
o Add some coments for future work.

# with these changes, we now make it through cninit, but there's still some
# problem that's preventing output, as well as another problem that causes
# us to call panic just after we return from cninit() in platform_start.


199737 24-Nov-2009 imp

Add size of octeon uart registers to map.


199594 20-Nov-2009 imp

If we're ompiling ISA_MIPS32, then use the 32-bit address-size
definitions.


199593 20-Nov-2009 imp

Don't assume register addresses can fit into void *. Minor formatting
simplification while I'm here.


199592 20-Nov-2009 imp

Formatting nit.


199207 12-Nov-2009 gonzo

MFC @199204


198669 30-Oct-2009 rrs

With this commit our friend RMI will now compile. I have
not tested it and the chances of it running yet are about
ZERO.. but it will now compile. The hard part now begins,
making it run ;-)


198154 15-Oct-2009 rrs

Does 4 things:
1) Adds future RMI directories
2) Places intr_machdep.c in specfic files.arch pointing to the generic
intr_machdep.c. This allows us to have an architecture dependant intr_machdep.c
(which we will need for RMI) in the machine specific directory
3) removes intr_machdep.c from files.mips
4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. We
may need to look at finding a better place to put this. But first I want to
get this thing compiling.


197717 02-Oct-2009 gonzo

- MFC


196988 08-Sep-2009 gonzo

- MFC from head@196987


196314 17-Aug-2009 imp

Implement platform_reset. Also, make the code a tiny bit easier to
read with ninja-C magic coupled with an illuminating comment.


196262 15-Aug-2009 imp

First cut at a platform_start. It is likely wrong, but it is better
than nothing :)


196259 15-Aug-2009 imp

The UART device infrasturcture wants these defined. Define them just
like we do in Malta. We may want to look at consolidating things
because *ALL* mips will *ALWAYS* be memory mapped. The only wrinkle
is that the tag may need to be a custom one (see endian issues with
the Atheros port for one example).


196237 15-Aug-2009 imp

Include Octeon specific registers since we mess with them here...


196236 15-Aug-2009 imp

Fix style error replicated multiple times. Move to
mips_bus_space_generic for octeon obio impl.


196062 04-Aug-2009 gonzo

- MFC @196061


195414 06-Jul-2009 imp

64-bit fixes: fix printf formats and prefer MIPS_PHYS_TO_KSEG0.


195413 06-Jul-2009 imp

GC some now-unused items. Fix for 64-bit build. Note: this breaks
the 32-bit build (which we're not computing correctly anyway).


195412 06-Jul-2009 imp

64-bit fixes:
(1) fix printf formats.
(2) Prefer FreeBSD's MIPS_PHYS_TO_KSEG0 to hand-rolled one from Cavium.
(3) Mark a few 64-bit cleanliness issues (possible).
(4) Minor formatting fixes.


195411 06-Jul-2009 imp

Minor fixes to printf formats.


195303 03-Jul-2009 gonzo

- MFC


194175 14-Jun-2009 imp

Minor formatting changes. Also, elimiante a couple of unused variables.


194174 14-Jun-2009 imp

Various nits to make this compile.


194173 14-Jun-2009 imp

Make compile.


194169 14-Jun-2009 imp

Hack for the 'battleship' boards that have 8 ports rather than 4.


194168 14-Jun-2009 imp

Compile out unreferenced code.


194167 14-Jun-2009 imp

Stylish nits


194166 14-Jun-2009 imp

Add bogus OCTEON_CORE_ID here. Really should integrate the pcpu.h stuff
that is in Cavium's base port.


194162 14-Jun-2009 imp

First pass to make compile. It doesn't completely yet, but it's a
start.


194161 14-Jun-2009 imp

Bring back the TARGET_OCTEON kludge for a bit. We need to kill it,
but it is useful for the moment.


194159 14-Jun-2009 imp

Move octeon specific uart goo here, per SOP for other MIPS ports.


194157 14-Jun-2009 imp

Move this to a more approrpiate plae.


194155 14-Jun-2009 imp

o Move the driveid.h file
o lots of tweaks to header paths.
o comment out SMP for the moment

# we now make it through the .c make depend, the .s needs more work.


194153 14-Jun-2009 imp

Move octeon rgmii driver to is more correct new home.


194150 14-Jun-2009 imp

Move dev/flash/ cf driver into octeon dir where it belongs.


194148 14-Jun-2009 imp

Actually rename the files this time. Also, start to fix OCTEON1 so it
can configure.


194143 14-Jun-2009 imp

Move the octeon port to its more correct location. Any port for the
OCTEON2 family of processors should live in mips/octeon2. Not enough
is know abotu the former to know if the same port can be used for both
yet.


194140 14-Jun-2009 imp

Import Cavium's FreeBSD port, or the Octeon specific pieces, verbatim.
Yes, this puts things in the wrong place, doesn't compile and is
woefully incomplete. However, it will allow us to more easily track
against the upstream sources without needing to import the entire
Cavium tree under vendor.

This port is based on FreeBSD 7.0 as of April 2007 and the pre-import
MIPS tree (aka mips2), so much work is necessary here.