Re: svn commit: r212374 - head/usr.bin/printf
On Thu, Sep 16, 2010 at 04:36, Bruce Evans wrote: > WHat about the lesser burder on a character or two for putting -- in the > synopsis where it is more visible: > > printf [--] format [arguments ...] Right, that's what I've been thinking about. For that matter, does printf(1) need to use getopt(3) at all? It seems like simply checking for "--" could be sufficient. Does POSIX require that it exit with an error if it's given any options? At the very least, it seems like it would be more productive to have printf(1) give unusually-helpful error messages (perhaps merely changing its usage output to match that synopsis) if it encounters a string beginning with '-' other than "--". ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r212809 - head/sys/mips/cavium/usb
Author: jmallett Date: Sat Sep 18 00:58:44 2010 New Revision: 212809 URL: http://svn.freebsd.org/changeset/base/212809 Log: Fix octusb build. Modified: head/sys/mips/cavium/usb/octusb.c Modified: head/sys/mips/cavium/usb/octusb.c == --- head/sys/mips/cavium/usb/octusb.c Sat Sep 18 00:46:05 2010 (r212808) +++ head/sys/mips/cavium/usb/octusb.c Sat Sep 18 00:58:44 2010 (r212809) @@ -1885,7 +1885,7 @@ octusb_xfer_unsetup(struct usb_xfer *xfe } static void -octusb_get_dma_delay(struct usb_bus *bus, uint32_t *pus) +octusb_get_dma_delay(struct usb_device *udev, uint32_t *pus) { /* DMA delay - wait until any use of memory is finished */ *pus = (2125); /* microseconds */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r212842 - head/sys/mips/cavium
Author: jmallett Date: Sun Sep 19 09:18:07 2010 New Revision: 212842 URL: http://svn.freebsd.org/changeset/base/212842 Log: Don't use memory that can't be direct-mapped on !n64. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Sun Sep 19 09:03:11 2010 (r212841) +++ head/sys/mips/cavium/octeon_machdep.c Sun Sep 19 09:18:07 2010 (r212842) @@ -286,6 +286,18 @@ octeon_memory_init(void) if (addr == -1) break; + /* +* The SDK needs to be able to easily map any memory that might +* come to it e.g. in the form of an mbuf. Because on !n64 we +* can't direct-map some addresses and we don't want to manage +* temporary mappings within the SDK, don't feed memory that +* can't be direct-mapped to the kernel. +*/ +#if !defined(__mips_n64) + if (!MIPS_DIRECT_MAPPABLE(addr + (1 << 20) - 1)) + continue; +#endif + physmem += btoc(1 << 20); if (i > 0 && phys_avail[i - 1] == addr) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r212843 - head/sys/mips/cavium
Author: jmallett Date: Sun Sep 19 09:18:27 2010 New Revision: 212843 URL: http://svn.freebsd.org/changeset/base/212843 Log: Fix to specify generic bus_add_child. Modified: head/sys/mips/cavium/obio.c head/sys/mips/cavium/octopci.c Modified: head/sys/mips/cavium/obio.c == --- head/sys/mips/cavium/obio.c Sun Sep 19 09:18:07 2010(r212842) +++ head/sys/mips/cavium/obio.c Sun Sep 19 09:18:27 2010(r212843) @@ -192,6 +192,8 @@ static device_method_t obio_methods[] = DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr), + DEVMETHOD(bus_add_child,bus_generic_add_child), + {0, 0}, }; Modified: head/sys/mips/cavium/octopci.c == --- head/sys/mips/cavium/octopci.c Sun Sep 19 09:18:07 2010 (r212842) +++ head/sys/mips/cavium/octopci.c Sun Sep 19 09:18:27 2010 (r212843) @@ -384,6 +384,8 @@ static device_method_t octopci_methods[] DEVMETHOD(bus_deactivate_resource,bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_add_child,bus_generic_add_child), + /* pcib interface */ DEVMETHOD(pcib_maxslots,octopci_maxslots), DEVMETHOD(pcib_read_config, octopci_read_config), ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r212844 - head/sys/contrib/octeon-sdk
Author: jmallett Date: Sun Sep 19 09:19:38 2010 New Revision: 212844 URL: http://svn.freebsd.org/changeset/base/212844 Log: Add preliminary support for the Lanner MR-955. It boots multi-user but there seem to be problems both with the on-board Ethernet interfaces and the em(4) interfaces on PCI under FreeBSD. Thanks to Lanner for providing access to hardware. Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper-spi.c head/sys/contrib/octeon-sdk/cvmx-helper.c head/sys/contrib/octeon-sdk/cvmx-spi.c Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h == --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Sun Sep 19 09:18:27 2010 (r212843) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Sun Sep 19 09:19:38 2010 (r212844) @@ -182,7 +182,11 @@ enum cvmx_board_types_enum { CVMX_BOARD_TYPE_CUST_ITB101 = 10005, CVMX_BOARD_TYPE_CUST_NTE102 = 10006, CVMX_BOARD_TYPE_CUST_AGS103 = 10007, +#if !defined(OCTEON_VENDOR_LANNER) CVMX_BOARD_TYPE_CUST_GST104 = 10008, +#else +CVMX_BOARD_TYPE_CUST_LANNER_MR955= 10008, +#endif CVMX_BOARD_TYPE_CUST_GCT105 = 10009, CVMX_BOARD_TYPE_CUST_AGS106 = 10010, CVMX_BOARD_TYPE_CUST_SGM107 = 10011, @@ -257,7 +261,11 @@ static inline const char *cvmx_board_typ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_ITB101) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NTE102) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS103) +#if !defined(OCTEON_VENDOR_LANNER) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GST104) +#else + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR955) +#endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT105) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS106) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_SGM107) Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c == --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Sun Sep 19 09:18:27 2010(r212843) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Sun Sep 19 09:19:38 2010(r212844) @@ -114,6 +114,9 @@ int cvmx_helper_board_get_mii_address(in case CVMX_BOARD_TYPE_EBT5800: case CVMX_BOARD_TYPE_THUNDER: case CVMX_BOARD_TYPE_NICPRO2: +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: +#endif /* Interface 0 is SPI4, interface 1 is RGMII */ if ((ipd_port >= 16) && (ipd_port < 20)) return ipd_port - 16; @@ -616,6 +619,12 @@ int __cvmx_helper_board_interface_probe( if (interface == 1) return 0; break; +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + if (interface == 1) + return 12; + break; +#endif } #ifdef CVMX_BUILD_FOR_UBOOT if (CVMX_HELPER_INTERFACE_MODE_SPI == cvmx_helper_interface_get_mode(interface) && getenv("disable_spi")) Modified: head/sys/contrib/octeon-sdk/cvmx-helper-spi.c == --- head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Sun Sep 19 09:18:27 2010(r212843) +++ head/sys/contrib/octeon-sdk/cvmx-helper-spi.c Sun Sep 19 09:19:38 2010(r212844) @@ -82,6 +82,21 @@ int __cvmx_helper_spi_probe(int interfac { num_ports = 10; } +#if defined(OCTEON_VENDOR_LANNER) +else if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_LANNER_MR955) +{ +cvmx_pko_reg_crc_enable_t enable; + if (interface == 1) { + num_ports = 12; + } else { + /* XXX This is not entirely true. */ + num_ports = 0; + } +enable.u64 = cvmx_read_csr(CVMX_PKO_REG_CRC_ENABLE); +enable.s.enable &= 0x << (16 - (interface*16)); +cvmx_write_csr(CVMX_PKO_REG_CRC_ENABLE, enable.u64); +} +#endif else { cvmx_pko_reg_crc_enable_t enable; Modified: head/sys/contrib/octeon-sdk/cvmx-helper.c == --- head/sys/contrib/octeon-sdk/cvmx-helper.c Sun Sep 19 09:18:27 2010 (r212843) +++ head/sys/contrib/octeon-sdk/cvmx-helper.c Sun Sep 19 09:19:38 2010 (r212844) @@ -101,6 +101,15 @@ static CVMX_SHARED cvmx_helper_link_info */ int cvmx_helper_get_number_of_interfaces(void) { +switch (cvmx_sysinfo_get()->board_type) { +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + return 2; +#endif + default: + break; +} + if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX)) return 4; else Modified: head/sys/contrib/octeon-
svn commit: r213089 - head/sys/mips/cavium
Author: jmallett Date: Fri Sep 24 00:14:24 2010 New Revision: 213089 URL: http://svn.freebsd.org/changeset/base/213089 Log: 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. Modified: head/sys/mips/cavium/octopci.c head/sys/mips/cavium/octopcireg.h Modified: head/sys/mips/cavium/octopci.c == --- head/sys/mips/cavium/octopci.c Thu Sep 23 23:05:31 2010 (r213088) +++ head/sys/mips/cavium/octopci.c Fri Sep 24 00:14:24 2010 (r213089) @@ -61,13 +61,19 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +#defineNPI_WRITE(addr, value) cvmx_write64_uint32((addr) ^ 4, (value)) +#defineNPI_READ(addr) cvmx_read64_uint32((addr) ^ 4) + struct octopci_softc { device_t sc_dev; unsigned sc_domain; unsigned sc_bus; + unsigned sc_io_next; struct rman sc_io; + + unsigned sc_mem1_next; struct rman sc_mem1; }; @@ -86,6 +92,9 @@ static void octopci_write_config(device_ uint32_t, int); static int octopci_route_interrupt(device_t, device_t, int); +static voidoctopci_init_bar(device_t, unsigned, unsigned, unsigned, unsigned); +static unsignedoctopci_init_device(device_t, unsigned, unsigned, unsigned, unsigned); +static unsignedoctopci_init_bus(device_t, unsigned); static uint64_toctopci_cs_addr(unsigned, unsigned, unsigned, unsigned); static void @@ -108,13 +117,205 @@ static int octopci_attach(device_t dev) { struct octopci_softc *sc; + cvmx_npi_mem_access_subid_t npi_mem_access_subid; + cvmx_npi_pci_int_arb_cfg_t npi_pci_int_arb_cfg; + cvmx_npi_ctl_status_t npi_ctl_status; + cvmx_pci_ctl_status_2_t pci_ctl_status_2; + cvmx_pci_cfg56_t pci_cfg56; + cvmx_pci_cfg22_t pci_cfg22; + cvmx_pci_cfg16_t pci_cfg16; + cvmx_pci_cfg19_t pci_cfg19; + cvmx_pci_cfg01_t pci_cfg01; + unsigned subbus; + unsigned i; int error; /* -* XXX -* We currently rely on U-Boot to set up the PCI in host state. We -* should properly initialize the PCI bus here. +* Reset the PCI bus. +*/ + cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x1); + cvmx_read_csr(CVMX_CIU_SOFT_PRST); + + DELAY(2000); + + npi_ctl_status.u64 = 0; + npi_ctl_status.s.max_word = 1; + npi_ctl_status.s.timer = 1; + cvmx_write_csr(CVMX_NPI_CTL_STATUS, npi_ctl_status.u64); + + /* +* Set host mode. +*/ + switch (cvmx_sysinfo_get()->board_type) { +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + /* 32-bit PCI-X */ + cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x0); + break; +#endif + default: + /* 64-bit PCI-X */ + cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x4); + break; + } + cvmx_read_csr(CVMX_CIU_SOFT_PRST); + + DELAY(2000); + + /* +* Enable BARs and configure big BAR mode. +*/ + pci_ctl_status_2.u32 = 0; + pci_ctl_status_2.s.bb1_hole = 5; /* 256MB hole in BAR1 */ + pci_ctl_status_2.s.bb1_siz = 1; /* BAR1 is 2GB */ + pci_ctl_status_2.s.bb_ca = 1; /* Bypass cache for big BAR */ + pci_ctl_status_2.s.bb_es = 1; /* Do big BAR byte-swapping */ + pci_ctl_status_2.s.bb1 = 1; /* BAR1 is big */ + pci_ctl_status_2.s.bb0 = 1; /* BAR0 is big */ + pci_ctl_status_2.s.bar2pres = 1; /* BAR2 present */ + pci_ctl_status_2.s.pmo_amod = 1; /* Round-robin priority */ + pci_ctl_status_2.s.tsr_hwm = 1; + pci_ctl_status_2.s.bar2_enb = 1; /* Enable BAR2 */ + pci_ctl_status_2.s.bar2_esx = 1; /* Do BAR2 byte-swapping */ + pci_ctl_status_2.s.bar2_cax = 1; /* Bypass cache for BAR2 */ + + NPI_WRITE(CVMX_NPI_PCI_CTL_STATUS_2, pci_ctl_status_2.u32); + + DELAY(2000); + + pci_ctl_status_2.u32 = NPI_READ(CVMX_NPI_PCI_CTL_STATUS_2); + + device_printf(dev, "%u-bit PCI%s bus.\n", + pci_ctl_status_2.s.ap_64ad ? 64 : 32, + pci_ctl_status_2.s.ap_pcix ? "-X" : ""); + + /* +* Set up transaction splitting, etc., parameters. +*/ + pci_cfg19.u32 = 0; + pci_cfg19.s.mrbcm =
svn commit: r213090 - head/sys/mips/cavium
Author: jmallett Date: Fri Sep 24 02:41:52 2010 New Revision: 213090 URL: http://svn.freebsd.org/changeset/base/213090 Log: 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. Modified: head/sys/mips/cavium/ciu.c head/sys/mips/cavium/octopci.c Modified: head/sys/mips/cavium/ciu.c == --- head/sys/mips/cavium/ciu.c Fri Sep 24 00:14:24 2010(r213089) +++ head/sys/mips/cavium/ciu.c Fri Sep 24 02:41:52 2010(r213090) @@ -78,6 +78,8 @@ static struct resource*ciu_alloc_resour static int ciu_setup_intr(device_t, device_t, struct resource *, int, driver_filter_t *, driver_intr_t *, void *, void **); +static int ciu_teardown_intr(device_t, device_t, + struct resource *, void *); static voidciu_hinted_child(device_t, const char *, int); static voidciu_en0_intr_mask(void *); @@ -230,6 +232,19 @@ ciu_setup_intr(device_t bus, device_t ch return (0); } +static int +ciu_teardown_intr(device_t bus, device_t child, struct resource *res, + void *cookie) +{ + int error; + + error = intr_event_remove_handler(cookie); + if (error != 0) + return (error); + + return (0); +} + static void ciu_hinted_child(device_t bus, const char *dname, int dunit) { @@ -342,7 +357,7 @@ static device_method_t ciu_methods[] = { DEVMETHOD(bus_alloc_resource, ciu_alloc_resource), DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), DEVMETHOD(bus_setup_intr, ciu_setup_intr), - DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr), + DEVMETHOD(bus_teardown_intr,ciu_teardown_intr), DEVMETHOD(bus_add_child,bus_generic_add_child), DEVMETHOD(bus_hinted_child, ciu_hinted_child), Modified: head/sys/mips/cavium/octopci.c == --- head/sys/mips/cavium/octopci.c Fri Sep 24 00:14:24 2010 (r213089) +++ head/sys/mips/cavium/octopci.c Fri Sep 24 02:41:52 2010 (r213090) @@ -658,6 +658,16 @@ octopci_init_device(device_t dev, unsign command |= PCIM_CMD_BUSMASTEREN; octopci_write_config(dev, b, s, f, PCIR_COMMAND, command, 1); + /* +* Set cache line size. On Octeon it should be 128 bytes, +* but according to Linux some Intel bridges have trouble +* with values over 64 bytes, so use 64 bytes. +*/ + octopci_write_config(dev, b, s, f, PCIR_CACHELNSZ, 16, 1); + + /* Set latency timer. */ + octopci_write_config(dev, b, s, f, PCIR_LATTIMER, 48, 1); + /* Configure PCI-PCI bridges. */ class = octopci_read_config(dev, b, s, f, PCIR_CLASS, 1); if (class != PCIC_BRIDGE) @@ -783,6 +793,7 @@ static device_method_t octopci_methods[] DEVMETHOD(bus_activate_resource,octopci_activate_resource), DEVMETHOD(bus_deactivate_resource,bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr), DEVMETHOD(bus_add_child,bus_generic_add_child), ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213140 - head/sys/mips/cavium
Author: jmallett Date: Fri Sep 24 21:23:23 2010 New Revision: 213140 URL: http://svn.freebsd.org/changeset/base/213140 Log: 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. Modified: head/sys/mips/cavium/files.octeon1 Modified: head/sys/mips/cavium/files.octeon1 == --- head/sys/mips/cavium/files.octeon1 Fri Sep 24 20:08:59 2010 (r213139) +++ head/sys/mips/cavium/files.octeon1 Fri Sep 24 21:23:23 2010 (r213140) @@ -39,30 +39,29 @@ mips/cavium/octopci_bus_space.c option mips/cavium/usb/octusb.c optional usb octusb mips/cavium/usb/octusb_octeon.coptional usb octusb -contrib/octeon-sdk/cvmx-cmd-queue.coptional octe -contrib/octeon-sdk/cvmx-fpa.c optional octe -contrib/octeon-sdk/cvmx-helper.c optional octe -contrib/octeon-sdk/cvmx-helper-board.c optional octe -contrib/octeon-sdk/cvmx-helper-errata.coptional octe -contrib/octeon-sdk/cvmx-helper-fpa.c optional octe -contrib/octeon-sdk/cvmx-helper-loop.c optional octe -contrib/octeon-sdk/cvmx-helper-npi.c optional octe -contrib/octeon-sdk/cvmx-helper-rgmii.c optional octe -contrib/octeon-sdk/cvmx-helper-sgmii.c optional octe -contrib/octeon-sdk/cvmx-helper-spi.c optional octe -contrib/octeon-sdk/cvmx-helper-util.c optional octe -contrib/octeon-sdk/cvmx-helper-xaui.c optional octe -contrib/octeon-sdk/cvmx-pko.c optional octe -contrib/octeon-sdk/cvmx-spi.c optional octe -contrib/octeon-sdk/cvmx-spi4000.c optional octe -contrib/octeon-sdk/cvmx-twsi.c optional octe - contrib/octeon-sdk/cvmx-usb.c optional octusb # XXX Some files could be excluded in some configurations. Making them # optional but on in the default config would seem reasonable. +contrib/octeon-sdk/cvmx-cmd-queue.cstandard contrib/octeon-sdk/cvmx-bootmem.c standard +contrib/octeon-sdk/cvmx-fpa.c standard +contrib/octeon-sdk/cvmx-helper.c standard +contrib/octeon-sdk/cvmx-helper-board.c standard +contrib/octeon-sdk/cvmx-helper-errata.cstandard +contrib/octeon-sdk/cvmx-helper-fpa.c standard +contrib/octeon-sdk/cvmx-helper-loop.c standard +contrib/octeon-sdk/cvmx-helper-npi.c standard +contrib/octeon-sdk/cvmx-helper-rgmii.c standard +contrib/octeon-sdk/cvmx-helper-sgmii.c standard +contrib/octeon-sdk/cvmx-helper-spi.c standard +contrib/octeon-sdk/cvmx-helper-util.c standard +contrib/octeon-sdk/cvmx-helper-xaui.c standard +contrib/octeon-sdk/cvmx-pko.c standard +contrib/octeon-sdk/cvmx-spi.c standard +contrib/octeon-sdk/cvmx-spi4000.c standard contrib/octeon-sdk/cvmx-sysinfo.c standard contrib/octeon-sdk/cvmx-thunder.c standard +contrib/octeon-sdk/cvmx-twsi.c standard contrib/octeon-sdk/cvmx-warn.c standard contrib/octeon-sdk/octeon-model.c standard ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213150 - head/sys/mips/cavium/octe
Author: jmallett Date: Sat Sep 25 01:18:01 2010 New Revision: 213150 URL: http://svn.freebsd.org/changeset/base/213150 Log: Handle link updates in a task. Modified: head/sys/mips/cavium/octe/cavium-ethernet.h head/sys/mips/cavium/octe/ethernet-rgmii.c head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/cavium-ethernet.h == --- head/sys/mips/cavium/octe/cavium-ethernet.h Sat Sep 25 00:01:55 2010 (r213149) +++ head/sys/mips/cavium/octe/cavium-ethernet.h Sat Sep 25 01:18:01 2010 (r213150) @@ -75,6 +75,8 @@ typedef struct { struct ifqueue tx_free_queue[16]; + int need_link_update; + struct task link_task; struct ifmedia media; int if_flags; Modified: head/sys/mips/cavium/octe/ethernet-rgmii.c == --- head/sys/mips/cavium/octe/ethernet-rgmii.c Sat Sep 25 00:01:55 2010 (r213149) +++ head/sys/mips/cavium/octe/ethernet-rgmii.c Sat Sep 25 01:18:01 2010 (r213150) @@ -136,27 +136,8 @@ static void cvm_oct_rgmii_poll(struct if link_info = cvmx_helper_link_autoconf(priv->port); priv->link_info = link_info.u64; + priv->need_link_update = 1; mtx_unlock_spin(&global_register_lock); - - /* Tell Linux */ - if (link_info.s.link_up) { - - if_link_state_change(ifp, LINK_STATE_UP); - if (priv->queue != -1) - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, queue %2d\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port, priv->queue); - else - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port); - } else { - - if_link_state_change(ifp, LINK_STATE_DOWN); - DEBUGPRINT("%s: Link down\n", if_name(ifp)); - } } Modified: head/sys/mips/cavium/octe/ethernet-sgmii.c == --- head/sys/mips/cavium/octe/ethernet-sgmii.c Sat Sep 25 00:01:55 2010 (r213149) +++ head/sys/mips/cavium/octe/ethernet-sgmii.c Sat Sep 25 01:18:01 2010 (r213150) @@ -93,25 +93,7 @@ static void cvm_oct_sgmii_poll(struct if link_info = cvmx_helper_link_autoconf(priv->port); priv->link_info = link_info.u64; - - /* Tell Linux */ - if (link_info.s.link_up) { - - if_link_state_change(ifp, LINK_STATE_UP); - if (priv->queue != -1) - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, queue %2d\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port, priv->queue); - else - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port); - } else { - if_link_state_change(ifp, LINK_STATE_DOWN); - DEBUGPRINT("%s: Link down\n", if_name(ifp)); - } + priv->need_link_update = 1; } int cvm_oct_sgmii_init(struct ifnet *ifp) Modified: head/sys/mips/cavium/octe/ethernet-xaui.c == --- head/sys/mips/cavium/octe/ethernet-xaui.c Sat Sep 25 00:01:55 2010 (r213149) +++ head/sys/mips/cavium/octe/ethernet-xaui.c Sat Sep 25 01:18:01 2010 (r213150) @@ -92,25 +92,7 @@ static void cvm_oct_xaui_poll(struct ifn link_info = cvmx_helper_link_autoconf(priv->port); priv->link_info = link_info.u64; - - /* Tell Linux */ - if (link_info.s.link_up) { - - if_link_state_change(ifp, LINK_STATE_UP); - if (priv->queue != -1) - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, queue %2d\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port, priv->queue); - else - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half"
svn commit: r213156 - head/sys/mips/cavium/octe
Author: jmallett Date: Sat Sep 25 04:39:12 2010 New Revision: 213156 URL: http://svn.freebsd.org/changeset/base/213156 Log: 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. Modified: head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/cavium/octe/octe.c Modified: head/sys/mips/cavium/octe/ethernet-rx.c == --- head/sys/mips/cavium/octe/ethernet-rx.c Sat Sep 25 04:26:40 2010 (r213155) +++ head/sys/mips/cavium/octe/ethernet-rx.c Sat Sep 25 04:39:12 2010 (r213156) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -167,7 +169,7 @@ static inline int cvm_oct_check_rcv_erro */ void cvm_oct_tasklet_rx(void *context, int pending) { - const int coreid = cvmx_get_core_num(); + int coreid; uint64_told_group_mask; uint64_told_scratch; int rx_count = 0; @@ -175,6 +177,9 @@ void cvm_oct_tasklet_rx(void *context, i int num_freed; int packet_not_copied; + sched_pin(); + coreid = cvmx_get_core_num(); + /* Prefetch cvm_oct_device since we know we need it soon */ CVMX_PREFETCH(cvm_oct_device, 0); @@ -388,6 +393,7 @@ void cvm_oct_tasklet_rx(void *context, i } } } + sched_unpin(); } Modified: head/sys/mips/cavium/octe/ethernet-tx.c == --- head/sys/mips/cavium/octe/ethernet-tx.c Sat Sep 25 04:26:40 2010 (r213155) +++ head/sys/mips/cavium/octe/ethernet-tx.c Sat Sep 25 04:39:12 2010 (r213156) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -239,6 +240,9 @@ int cvm_oct_xmit(struct mbuf *m, struct } else { /* Put this packet on the queue to be freed later */ _IF_ENQUEUE(&priv->tx_free_queue[qos], m); + + /* Pass it to any BPF listeners. */ + ETHER_BPF_MTAP(ifp, m); } if (work != NULL) cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1)); Modified: head/sys/mips/cavium/octe/octe.c == --- head/sys/mips/cavium/octe/octe.cSat Sep 25 04:26:40 2010 (r213155) +++ head/sys/mips/cavium/octe/octe.cSat Sep 25 04:39:12 2010 (r213156) @@ -310,24 +310,6 @@ octe_start(struct ifnet *ifp) OCTE_TX_UNLOCK(priv); - /* -* XXX -* -* We may not be able to pass the mbuf up to BPF for one of -* two very good reasons: -* (1) immediately after our inserting it another CPU may be -* kind enough to free it for us. -* (2) m_collapse gets called on m and we don't get back the -* modified pointer. -* -* We have some options other than an m_dup route: -* (1) use a mutex or spinlock to prevent another CPU from -* freeing it. We could lock the tx_free_list's lock, -* that would make sense. -* (2) get back the new mbuf pointer. -* (3) do the collapse here. -*/ - if (priv->queue != -1) { error = cvm_oct_xmit(m, ifp); } else { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213227 - head/sys/conf
Author: jmallett Date: Mon Sep 27 19:45:34 2010 New Revision: 213227 URL: http://svn.freebsd.org/changeset/base/213227 Log: Use a single program header to fix loading 64-bit kernels on old versions of U-Boot. Modified: head/sys/conf/ldscript.mips.octeon1.64 Modified: head/sys/conf/ldscript.mips.octeon1.64 == --- head/sys/conf/ldscript.mips.octeon1.64 Mon Sep 27 19:36:15 2010 (r213226) +++ head/sys/conf/ldscript.mips.octeon1.64 Mon Sep 27 19:45:34 2010 (r213227) @@ -7,24 +7,29 @@ ENTRY(_start) __DYNAMIC = 0; PROVIDE (_DYNAMIC = 0); +PHDRS { + text PT_LOAD FLAGS(0x7); +} + SECTIONS { . = KERNLOADADDR + SIZEOF_HEADERS; - .text . : { + .text : { *(.text) *(.dynamic) etext = .; _etext = .; . = ALIGN(0x2000); - } + } : text - .rodata ALIGN(0x2000) : { + . = ALIGN(0x2000); + .rodata : { _fdata = .; *(.rodata) . = ALIGN(32); } - .data . : { + .data : { _rwdata = .; *(.data) . = ALIGN(32); @@ -33,15 +38,15 @@ SECTIONS { _gp = (. + 0x8000); - .sdata . : { + .sdata : { _small_start = .; *(.sdata) . = ALIGN(32); edata = .; _edata = .; - } + } : text - .sbss . : { + .sbss : { __bss_start = .; _fbss = .; *(.sbss) *(.scommon) @@ -49,7 +54,7 @@ SECTIONS { . = ALIGN(32); } - .bss . : { + .bss : { *(.bss) *(COMMON) . = ALIGN(32); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213228 - head/sys/mips/cavium
Author: jmallett Date: Mon Sep 27 20:12:57 2010 New Revision: 213228 URL: http://svn.freebsd.org/changeset/base/213228 Log: 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. Modified: head/sys/mips/cavium/octopci.c Modified: head/sys/mips/cavium/octopci.c == --- head/sys/mips/cavium/octopci.c Mon Sep 27 19:45:34 2010 (r213227) +++ head/sys/mips/cavium/octopci.c Mon Sep 27 20:12:57 2010 (r213228) @@ -92,7 +92,7 @@ static void octopci_write_config(device_ uint32_t, int); static int octopci_route_interrupt(device_t, device_t, int); -static voidoctopci_init_bar(device_t, unsigned, unsigned, unsigned, unsigned); +static voidoctopci_init_bar(device_t, unsigned, unsigned, unsigned, unsigned, uint8_t *); static unsignedoctopci_init_device(device_t, unsigned, unsigned, unsigned, unsigned); static unsignedoctopci_init_bus(device_t, unsigned); static uint64_toctopci_cs_addr(unsigned, unsigned, unsigned, unsigned); @@ -148,6 +148,7 @@ octopci_attach(device_t dev) */ switch (cvmx_sysinfo_get()->board_type) { #if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR320: case CVMX_BOARD_TYPE_CUST_LANNER_MR955: /* 32-bit PCI-X */ cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x0); @@ -422,14 +423,14 @@ octopci_alloc_resource(device_t bus, dev break; case SYS_RES_IOPORT: rman_set_bushandle(res, CVMX_ADDR_DID(CVMX_FULL_DID(CVMX_OCT_DID_PCI, CVMX_OCT_SUBDID_PCI_IO)) + rman_get_start(res)); +#if __mips_n64 + rman_set_virtual(res, (void *)rman_get_bushandle(res)); +#else /* * XXX -* We should just disallow use of io ports on !n64 since without -* 64-bit PTEs we can't even do a 32-bit virtual address -* mapped to them. +* We can't access ports via a 32-bit pointer. */ -#if 0 - rman_set_virtual(res, (void *)rman_get_bushandle(res)); + rman_set_virtual(res, NULL); #endif break; } @@ -549,8 +550,19 @@ octopci_route_interrupt(device_t dev, de slot = pci_get_slot(child); func = pci_get_function(child); -#if defined(OCTEON_VENDOR_LANNER) + /* +* Board types we have to know at compile-time. +*/ +#if defined(OCTEON_BOARD_CAPK_0100ND) + if (bus == 0 && slot == 12 && func == 0) + return (CVMX_IRQ_PCI_INT2); +#endif + + /* +* For board types we can determine at runtime. +*/ switch (cvmx_sysinfo_get()->board_type) { +#if defined(OCTEON_VENDOR_LANNER) case CVMX_BOARD_TYPE_CUST_LANNER_MR955: return (CVMX_IRQ_PCI_INT0 + pin - 1); case CVMX_BOARD_TYPE_CUST_LANNER_MR320: @@ -562,10 +574,10 @@ octopci_route_interrupt(device_t dev, de return (CVMX_IRQ_PCI_INT0 + (irq & 3)); } break; +#endif default: break; } -#endif irq = slot + pin - 3; @@ -573,7 +585,7 @@ octopci_route_interrupt(device_t dev, de } static void -octopci_init_bar(device_t dev, unsigned b, unsigned s, unsigned f, unsigned barnum) +octopci_init_bar(device_t dev, unsigned b, unsigned s, unsigned f, unsigned barnum, uint8_t *commandp) { struct octopci_softc *sc; uint32_t bar; @@ -603,6 +615,11 @@ octopci_init_bar(device_t dev, unsigned octopci_write_config(dev, b, s, f, PCIR_BAR(barnum), CVMX_OCT_PCI_IO_BASE + sc->sc_io_next, 4); sc->sc_io_next += size; + + /* +* Enable I/O ports. +*/ + *commandp |= PCIM_CMD_PORTEN; } else { size = ~(bar & (uint32_t)PCIM_BAR_MEM_BASE) + 1; @@ -615,6 +632,11 @@ octopci_init_bar(device_t dev, unsigned octopci_write_config(dev, b, s, f, PCIR_BAR(barnum), CVMX_OCT_PCI_MEM1_BASE + sc->sc_mem1_next, 4); sc->sc_mem1_next += size; + + /* +* Enable memory access. +*/ + *commandp |= PCIM_CMD_MEMEN; } } @@ -630,6 +652,13 @@ octopci_init_device(device_t dev, unsign /* Read header type (again.) */ hdrtype = octopci_read_config(dev, b, s, f, PCIR_HDRTYPE, 1); + /* +* Dis
svn commit: r213230 - head/sys/mips/cavium
Author: jmallett Date: Mon Sep 27 20:35:40 2010 New Revision: 213230 URL: http://svn.freebsd.org/changeset/base/213230 Log: 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. Modified: head/sys/mips/cavium/octopci.c Modified: head/sys/mips/cavium/octopci.c == --- head/sys/mips/cavium/octopci.c Mon Sep 27 20:31:03 2010 (r213229) +++ head/sys/mips/cavium/octopci.c Mon Sep 27 20:35:40 2010 (r213230) @@ -659,6 +659,8 @@ octopci_init_device(device_t dev, unsign command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); octopci_write_config(dev, b, s, f, PCIR_COMMAND, command, 1); + DELAY(1); + /* Program BARs. */ switch (hdrtype & PCIM_HDRTYPE) { case PCIM_HDRTYPE_NORMAL: @@ -685,6 +687,8 @@ octopci_init_device(device_t dev, unsign /* Enable whatever facilities the BARs require. */ octopci_write_config(dev, b, s, f, PCIR_COMMAND, command, 1); + DELAY(1); + /* * Set cache line size. On Octeon it should be 128 bytes, * but according to Linux some Intel bridges have trouble ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213340 - head/sys/mips/conf
Author: jmallett Date: Sat Oct 2 01:24:20 2010 New Revision: 213340 URL: http://svn.freebsd.org/changeset/base/213340 Log: Make the OCTEON1 configuration look like a normal GENERIC configuration. In particular, add PCI and USB buses and most devices. Also move to using ULE, adding INET6, turning on WITNESS by default, etc. Modified: head/sys/mips/conf/OCTEON1 Modified: head/sys/mips/conf/OCTEON1 == --- head/sys/mips/conf/OCTEON1 Sat Oct 2 00:57:41 2010(r213339) +++ head/sys/mips/conf/OCTEON1 Sat Oct 2 01:24:20 2010(r213340) @@ -1,7 +1,8 @@ -# OCTEON1 -- Configuration kernel for all Octeon1 SoCs from Cavium Networks # -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: +# OCTEON1 -- Generic kernel configuration file for FreeBSD/MIPS on Cavium Octeon +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # @@ -11,19 +12,12 @@ # latest information. # # An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # # $FreeBSD$ -## -###### -### PLEASE NOTE: This file is the experimental 64-bit kernel. If you want ### -### a stable kernel, please use the 32-bit OCTEON1-32 instead. ### -###### -## - machinemips cpuCPU_CNMIPS ident OCTEON1 @@ -42,61 +36,261 @@ hints "OCTEON1.hints" #Default places makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols -#XXXimp: Need to make work with 64-bit too -optionsISA_MIPS64 - -optionsDDB -optionsKDB - -optionsSCHED_4BSD #4BSD scheduler -optionsINET#InterNETworking -optionsNFSCLIENT #Network Filesystem Client -#options NFS_ROOT#NFS usable as /, requires NFSCLIENT -optionsPSEUDOFS#Pseudo-filesystem framework -options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -#options ROOTDEVNAME=\"ufs:ad0s1a\" # Original -optionsNO_SWAPPING - - -optionsFFS #Berkeley Fast Filesystem -optionsSOFTUPDATES #Enable FFS soft updates support -optionsUFS_ACL #Support for access control lists -optionsUFS_DIRHASH #Improve performance on big directories - - -# Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver -optionsINVARIANTS #Enable calls of extra sanity checking -optionsINVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN#Don't run witness on spinlocks for speed - -optionsSMP - # Board-specific support that cannot be auto-detected at runtime. #options OCTEON_VENDOR_LANNER# Support for Lanner boards. #options OCTEON_BOARD_CAPK_0100ND# Support for CAPK-0100nd. -device loop -device ether -device md -device uart -nodevice uart_ns8250 -device miibus -device octe -#options VERBOSE_SYSINIT - -device bpf -device random - -# -# Use the following for Compact Flash file-system -device cf -optionsROOTDEVNAME=\"ufs:cf0s2a\" # Unmask if compact flash is needed as RFS +# XXX This option is very nearly irrelevant. +optionsISA_MIPS64 -# -# Use the following for RFS in mem-device -#options MD_ROOT -#options ROOTDEVNAME=\"ufs:md0\" +optionsSCHED_ULE # ULE scheduler +optionsPREEMPTION # Enable kernel thread preemption +optionsINET# InterNETworking +optionsINET6 # IPv6 communications protocols +optionsSCTP# Stream Control Transmission Protocol +optionsFFS # Berkeley Fast Filesystem +optionsSOFTUPDATES # Enable FFS
svn commit: r213341 - head/sys/mips/cavium
Author: jmallett Date: Sat Oct 2 01:28:18 2010 New Revision: 213341 URL: http://svn.freebsd.org/changeset/base/213341 Log: Remove extra cpu setting and commented-out devices, some of which don't exist. Modified: head/sys/mips/cavium/std.octeon1 Modified: head/sys/mips/cavium/std.octeon1 == --- head/sys/mips/cavium/std.octeon1Sat Oct 2 01:24:20 2010 (r213340) +++ head/sys/mips/cavium/std.octeon1Sat Oct 2 01:28:18 2010 (r213341) @@ -5,15 +5,3 @@ # $FreeBSD$ # files "../cavium/files.octeon1" - -# -# -# -cpu CPU_MIPS4KC -#devicepci -#deviceata -#deviceatadisk - -#device clock -#device obio -#device uart ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213342 - head/sys/mips/mips
Author: jmallett Date: Sat Oct 2 01:29:09 2010 New Revision: 213342 URL: http://svn.freebsd.org/changeset/base/213342 Log: Use ABI-aware macros for setting up a fake frame. Modified: head/sys/mips/mips/locore.S Modified: head/sys/mips/mips/locore.S == --- head/sys/mips/mips/locore.S Sat Oct 2 01:28:18 2010(r213341) +++ head/sys/mips/mips/locore.S Sat Oct 2 01:29:09 2010(r213342) @@ -161,11 +161,11 @@ VECTOR(_locore, unknown) /* * Initialize stack and call machine startup. */ - PTR_LA sp, _C_LABEL(pcpu_space) - addiu sp, (PAGE_SIZE * 2) - CALLFRAME_SIZ + PTR_LA sp, _C_LABEL(pcpu_space) + PTR_ADDUsp, (PAGE_SIZE * 2) - CALLFRAME_SIZ - sw zero, CALLFRAME_SIZ - 4(sp) # Zero out old ra for debugger - sw zero, CALLFRAME_SIZ - 8(sp) # Zero out old fp for debugger + REG_S zero, CALLFRAME_RA(sp) # Zero out old ra for debugger + REG_S zero, CALLFRAME_SP(sp) # Zero out old fp for debugger PTR_LA gp, _C_LABEL(_gp) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213345 - head/sys/mips/cavium
Author: jmallett Date: Sat Oct 2 05:38:45 2010 New Revision: 213345 URL: http://svn.freebsd.org/changeset/base/213345 Log: 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. Modified: head/sys/mips/cavium/uart_bus_octeonusart.c head/sys/mips/cavium/uart_cpu_octeonusart.c head/sys/mips/cavium/uart_dev_oct16550.c Modified: head/sys/mips/cavium/uart_bus_octeonusart.c == --- head/sys/mips/cavium/uart_bus_octeonusart.c Sat Oct 2 02:46:32 2010 (r213344) +++ head/sys/mips/cavium/uart_bus_octeonusart.c Sat Oct 2 05:38:45 2010 (r213345) @@ -105,11 +105,10 @@ uart_octeon_probe(device_t dev) sc->sc_bas.bst = uart_bus_space_mem; /* * XXX -* RBR isn't really a great base address and it'd be great to not have -* a hard-coded 1024. +* RBR isn't really a great base address. */ - if (bus_space_map(sc->sc_bas.bst, CVMX_MIO_UARTX_RBR(0), 1024, - 0, &sc->sc_bas.bsh) != 0) + if (bus_space_map(sc->sc_bas.bst, CVMX_MIO_UARTX_RBR(0), + uart_getrange(sc->sc_class), 0, &sc->sc_bas.bsh) != 0) return (ENXIO); return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, unit)); } Modified: head/sys/mips/cavium/uart_cpu_octeonusart.c == --- head/sys/mips/cavium/uart_cpu_octeonusart.c Sat Oct 2 02:46:32 2010 (r213344) +++ head/sys/mips/cavium/uart_cpu_octeonusart.c Sat Oct 2 05:38:45 2010 (r213345) @@ -58,56 +58,56 @@ static uint8_t ou_bs_r_1(void *t, bus_space_handle_t handle, bus_size_t offset) { - return (oct_read64(handle + (offset << 3))); + return (oct_read64(handle + offset)); } static uint16_t ou_bs_r_2(void *t, bus_space_handle_t handle, bus_size_t offset) { - return (oct_read64(handle + (offset << 3))); + return (oct_read64(handle + offset)); } static uint32_t ou_bs_r_4(void *t, bus_space_handle_t handle, bus_size_t offset) { - return (oct_read64(handle + (offset << 3))); + return (oct_read64(handle + offset)); } static uint64_t ou_bs_r_8(void *t, bus_space_handle_t handle, bus_size_t offset) { - return (oct_read64(handle + (offset << 3))); + return (oct_read64(handle + offset)); } static void ou_bs_w_1(void *t, bus_space_handle_t bsh, bus_size_t offset, uint8_t value) { - oct_write64(bsh + (offset << 3), value); + oct_write64(bsh + offset, value); } static void ou_bs_w_2(void *t, bus_space_handle_t bsh, bus_size_t offset, uint16_t value) { - oct_write64(bsh + (offset << 3), value); + oct_write64(bsh + offset, value); } static void ou_bs_w_4(void *t, bus_space_handle_t bsh, bus_size_t offset, uint32_t value) { - oct_write64(bsh + (offset << 3), value); + oct_write64(bsh + offset, value); } static void ou_bs_w_8(void *t, bus_space_handle_t bsh, bus_size_t offset, uint64_t value) { - oct_write64(bsh + (offset << 3), value); + oct_write64(bsh + offset, value); } struct bus_space octeon_uart_tag = { @@ -160,10 +160,10 @@ uart_cpu_getdev(int devtype, struct uart di->ops = uart_getops(class); di->bas.chan = 0; /* XXX */ - if (bus_space_map(di->bas.bst, CVMX_MIO_UARTX_RBR(0), 1024, - 0, &di->bas.bsh) != 0) + if (bus_space_map(di->bas.bst, CVMX_MIO_UARTX_RBR(0), + uart_getrange(class), 0, &di->bas.bsh) != 0) return (ENXIO); - di->bas.regshft = 0; + di->bas.regshft = 3; di->bas.rclk = 0; di->baudrate = 115200; di->databits = 8; Modified: head/sys/mips/cavium/uart_dev_oct16550.c == --- head/sys/mips/cavium/uart_dev_oct16550.cSat Oct 2 02:46:32 2010 (r213344) +++ head/sys/mips/cavium/uart_dev_oct16550.cSat Oct 2 05:38:45 2010 (r213345) @@ -420,7 +420,7 @@ struct uart_class uart_oct16550_class = oct16550_methods, sizeof(struct oct16550_softc), .uc_ops = &uart_oct16550_ops, - .uc_range = 8, + .uc_range = 8 << 3, .uc_rclk = 0 }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213346 - in head/sys: contrib/octeon-sdk mips/cavium mips/cavium/octe
ethernet-mdio.c Sat Oct 2 05:43:17 2010 (r213346) @@ -132,6 +132,8 @@ int cvm_oct_mdio_setup_device(struct ifn cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; priv->phy_id = cvmx_helper_board_get_mii_address(priv->port); + priv->mdio_read = NULL; + priv->mdio_write = NULL; return 0; } Added: head/sys/mips/cavium/octe/ethernet-mv88e61xx.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octe/ethernet-mv88e61xx.c Sat Oct 2 05:43:17 2010 (r213346) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2010 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Interface to the Marvell 88E61XX SMI/MDIO. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "wrapper-cvmx-includes.h" +#include "ethernet-headers.h" + +#defineMV88E61XX_SMI_PHY_SW0x10/* Switch PHY. */ + +#defineMV88E61XX_SMI_REG_CMD 0x00/* Indirect command register. */ +#define MV88E61XX_SMI_CMD_BUSY 0x8000 /* Busy bit. */ +#define MV88E61XX_SMI_CMD_22 0x1000 /* Clause 22 (default 45.) */ +#define MV88E61XX_SMI_CMD_READ 0x0800 /* Read command. */ +#define MV88E61XX_SMI_CMD_WRITE0x0400 /* Write command. */ +#define MV88E61XX_SMI_CMD_PHY(phy) (((phy) & 0x1f) << 5) +#define MV88E61XX_SMI_CMD_REG(reg) ((reg) & 0x1f) + +#defineMV88E61XX_SMI_REG_DAT 0x01/* Indirect data register. */ + +static int cvm_oct_mv88e61xx_mdio_read(struct ifnet *, int, int); +static void cvm_oct_mv88e61xx_mdio_write(struct ifnet *, int, int, int); +static int cvm_oct_mv88e61xx_smi_read(struct ifnet *, int, int); +static void cvm_oct_mv88e61xx_smi_write(struct ifnet *, int, int, int); +static int cvm_oct_mv88e61xx_smi_wait(struct ifnet *, int); + +int +cvm_oct_mv88e61xx_setup_device(struct ifnet *ifp) +{ + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + + priv->mdio_read = cvm_oct_mv88e61xx_mdio_read; + priv->mdio_write = cvm_oct_mv88e61xx_mdio_write; + + return (0); +} + +static int +cvm_oct_mv88e61xx_mdio_read(struct ifnet *ifp, int phy_id, int location) +{ + /* +* Intercept reads of MII_BMSR. The miibus uses this to determine +* PHY presence and we only want it to look for a PHY attachment +* for the switch PHY itself. The PHY driver will talk to all of +* the other ports as need be. +*/ + switch (location) { + case MII_BMSR: + if (phy_id != MV88E61XX_SMI_PHY_SW) + return (0); + return (BMSR_EXTSTAT | BMSR_ACOMP | BMSR_LINK); + default: + return (cvm_oct_mv88e61xx_smi_read(ifp, phy_id, location)); + } +} + +static void +cvm_oct_mv88e61xx_mdio_write(struct ifnet *ifp, int phy_id, int location, int val) +{ + return (cvm_oct_mv88e61xx_smi_write(ifp, phy_id, location, val)); +} + +static int +cvm_oct_mv88e61xx_smi_read(struct ifnet *ifp, int phy_id, int location) +{ + int error; + + error = cvm_oct_mv88e61xx_smi_wait(ifp, phy_id); + if (error != 0) + return (0); + + cvm_oct_mdio_write(ifp, phy_id, MV88E61XX_SMI_REG_CMD, + MV88E61XX_SMI_CMD_BUSY | MV88E61XX_SMI_CMD_22 | + MV88E61XX_SMI_CMD_READ | MV88E61XX_SMI_CMD_PHY(phy_id) | +
svn commit: r213762 - in head/sys/mips: cavium cavium/octe conf
PHY. */ - #defineMV88E61XX_SMI_REG_CMD 0x00/* Indirect command register. */ #define MV88E61XX_SMI_CMD_BUSY 0x8000 /* Busy bit. */ #define MV88E61XX_SMI_CMD_22 0x1000 /* Clause 22 (default 45.) */ @@ -61,89 +59,67 @@ __FBSDID("$FreeBSD$"); #defineMV88E61XX_SMI_REG_DAT 0x01/* Indirect data register. */ -static int cvm_oct_mv88e61xx_mdio_read(struct ifnet *, int, int); -static void cvm_oct_mv88e61xx_mdio_write(struct ifnet *, int, int, int); static int cvm_oct_mv88e61xx_smi_read(struct ifnet *, int, int); static void cvm_oct_mv88e61xx_smi_write(struct ifnet *, int, int, int); -static int cvm_oct_mv88e61xx_smi_wait(struct ifnet *, int); +static int cvm_oct_mv88e61xx_smi_wait(struct ifnet *); int cvm_oct_mv88e61xx_setup_device(struct ifnet *ifp) { cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - priv->mdio_read = cvm_oct_mv88e61xx_mdio_read; - priv->mdio_write = cvm_oct_mv88e61xx_mdio_write; + priv->mdio_read = cvm_oct_mv88e61xx_smi_read; + priv->mdio_write = cvm_oct_mv88e61xx_smi_write; + priv->phy_device = "mv88e61xxphy"; return (0); } static int -cvm_oct_mv88e61xx_mdio_read(struct ifnet *ifp, int phy_id, int location) -{ - /* -* Intercept reads of MII_BMSR. The miibus uses this to determine -* PHY presence and we only want it to look for a PHY attachment -* for the switch PHY itself. The PHY driver will talk to all of -* the other ports as need be. -*/ - switch (location) { - case MII_BMSR: - if (phy_id != MV88E61XX_SMI_PHY_SW) - return (0); - return (BMSR_EXTSTAT | BMSR_ACOMP | BMSR_LINK); - default: - return (cvm_oct_mv88e61xx_smi_read(ifp, phy_id, location)); - } -} - -static void -cvm_oct_mv88e61xx_mdio_write(struct ifnet *ifp, int phy_id, int location, int val) -{ - return (cvm_oct_mv88e61xx_smi_write(ifp, phy_id, location, val)); -} - -static int cvm_oct_mv88e61xx_smi_read(struct ifnet *ifp, int phy_id, int location) { + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; int error; - error = cvm_oct_mv88e61xx_smi_wait(ifp, phy_id); + error = cvm_oct_mv88e61xx_smi_wait(ifp); if (error != 0) return (0); - cvm_oct_mdio_write(ifp, phy_id, MV88E61XX_SMI_REG_CMD, + cvm_oct_mdio_write(ifp, priv->phy_id, MV88E61XX_SMI_REG_CMD, MV88E61XX_SMI_CMD_BUSY | MV88E61XX_SMI_CMD_22 | MV88E61XX_SMI_CMD_READ | MV88E61XX_SMI_CMD_PHY(phy_id) | MV88E61XX_SMI_CMD_REG(location)); - error = cvm_oct_mv88e61xx_smi_wait(ifp, phy_id); + error = cvm_oct_mv88e61xx_smi_wait(ifp); if (error != 0) return (0); - return (cvm_oct_mdio_read(ifp, phy_id, MV88E61XX_SMI_REG_DAT)); + return (cvm_oct_mdio_read(ifp, priv->phy_id, MV88E61XX_SMI_REG_DAT)); } static void cvm_oct_mv88e61xx_smi_write(struct ifnet *ifp, int phy_id, int location, int val) { - cvm_oct_mv88e61xx_smi_wait(ifp, phy_id); - cvm_oct_mdio_write(ifp, phy_id, MV88E61XX_SMI_REG_DAT, val); - cvm_oct_mdio_write(ifp, phy_id, MV88E61XX_SMI_REG_CMD, + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + + cvm_oct_mv88e61xx_smi_wait(ifp); + cvm_oct_mdio_write(ifp, priv->phy_id, MV88E61XX_SMI_REG_DAT, val); + cvm_oct_mdio_write(ifp, priv->phy_id, MV88E61XX_SMI_REG_CMD, MV88E61XX_SMI_CMD_BUSY | MV88E61XX_SMI_CMD_22 | MV88E61XX_SMI_CMD_WRITE | MV88E61XX_SMI_CMD_PHY(phy_id) | MV88E61XX_SMI_CMD_REG(location)); - cvm_oct_mv88e61xx_smi_wait(ifp, phy_id); + cvm_oct_mv88e61xx_smi_wait(ifp); } static int -cvm_oct_mv88e61xx_smi_wait(struct ifnet *ifp, int phy_id) +cvm_oct_mv88e61xx_smi_wait(struct ifnet *ifp) { + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; uint16_t cmd; unsigned i; for (i = 0; i < 1; i++) { - cmd = cvm_oct_mdio_read(ifp, phy_id, MV88E61XX_SMI_REG_CMD); + cmd = cvm_oct_mdio_read(ifp, priv->phy_id, MV88E61XX_SMI_REG_CMD); if ((cmd & MV88E61XX_SMI_CMD_BUSY) == 0) return (0); } Added: head/sys/mips/cavium/octe/mv88e61xxphy.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octe/mv88e61xxphy.cWed Oct 13 09:17:44 2010 (r213762) @@ -0,0 +1,630 @@ +/*- + * Copyright (c) 2010 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributio
svn commit: r213807 - head/sys/mips/cavium/octe
Author: jmallett Date: Wed Oct 13 21:45:56 2010 New Revision: 213807 URL: http://svn.freebsd.org/changeset/base/213807 Log: Keep polling at 50hz as long as link state is changing. Modified: head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/ethernet.c == --- head/sys/mips/cavium/octe/ethernet.cWed Oct 13 21:37:02 2010 (r213806) +++ head/sys/mips/cavium/octe/ethernet.cWed Oct 13 21:45:56 2010 (r213807) @@ -173,6 +173,7 @@ static void cvm_oct_update_link(void *co static void cvm_do_timer(void *arg) { static int port; + static int updated; if (port < CVMX_PIP_NUM_INPUT_PORTS) { if (cvm_oct_device[port]) { int queues_per_port; @@ -186,6 +187,7 @@ static void cvm_do_timer(void *arg) MDIO_UNLOCK(); if (priv->need_link_update) { + updated++; taskqueue_enqueue(cvm_oct_link_taskq, &priv->link_task); } } @@ -220,9 +222,19 @@ static void cvm_do_timer(void *arg) callout_reset(&cvm_oct_poll_timer, hz / 50, cvm_do_timer, NULL); } else { port = 0; - /* All ports have been polled. Start the next iteration through - the ports in one second */ - callout_reset(&cvm_oct_poll_timer, hz, cvm_do_timer, NULL); + /* If any updates were made in this run, continue iterating at +* 1/50th of a second, so that if a link has merely gone down +* temporarily (e.g. because of interface reinitialization) it +* will not be forced to stay down for an entire second. +*/ + if (updated > 0) { + updated = 0; + callout_reset(&cvm_oct_poll_timer, hz / 50, cvm_do_timer, NULL); + } else { + /* All ports have been polled. Start the next iteration through + the ports in one second */ + callout_reset(&cvm_oct_poll_timer, hz, cvm_do_timer, NULL); + } } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r214431 - head/bin/rm
On Wed, Oct 27, 2010 at 14:48, Alexander Best wrote: > On Wed Oct 27 10, Doug Barton wrote: >> What may be a better approach is to confirm the fs' that DO work, list >> them, and then add something to the effect of, "This feature is unlikely >> to work on other file systems." > > i don't think that's a good approach, because then the rm(1) has to be changed > everytime freebsd gets a new fs which works with the -P option. i think it's > better to list which fs semantics DON'T work. so if freebsd gets a new fs, > users simply have to know which semantics the new fs is based on and can > decide > for themselves whether the -P switch will work or not. > > so far the -P option doesn't seem to work for: > > - COW fs and/or > - fs with a variable block size and/or > - fs which do journaling I really don't want to ask the average user to know whether their filesystem is in-place block-rewriting or not. That's just silly. In this case Doug is right; I don't think FreeBSD gets new file systems as often as you think that it would be a big burden. Having a general description of the types of filesystem it can work on might be useful, but a list seems more useful still. Listing the types it can't work on is backwards because that requires a user to understand the dichotomy as well as knowing what kind of filesystem they don't have / do have. And for them to never get it backwards. At least mount(8) will tell you what filesystem you are using; there's no tool to tell you the properties of your filesystem, and good luck easily-mining an answer to the question of whether your filesystem fits into that category from a manpage without introducing substantial confusion. Maybe there should be substantial confusion around this feature, though, since that's what it seems to be there for. Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214708 - head/sys/mips/cavium
Author: jmallett Date: Tue Nov 2 23:43:44 2010 New Revision: 214708 URL: http://svn.freebsd.org/changeset/base/214708 Log: Declare the CF GEOM class so that g_modevent will get called, the class will be recorded, etc. This fixes libgeom on Octeon. Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c == --- head/sys/mips/cavium/octeon_ebt3000_cf.cTue Nov 2 23:43:27 2010 (r214707) +++ head/sys/mips/cavium/octeon_ebt3000_cf.cTue Nov 2 23:43:44 2010 (r214708) @@ -148,6 +148,8 @@ struct g_class g_cf_class = { .ioctl =cf_ioctl, }; +DECLARE_GEOM_CLASS(g_cf_class, g_cf); + /* Device methods */ static int cf_probe(device_t); static voidcf_identify(driver_t *, device_t); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214766 - head/sys/mips/cavium
Author: jmallett Date: Wed Nov 3 23:29:52 2010 New Revision: 214766 URL: http://svn.freebsd.org/changeset/base/214766 Log: Don't attach the PCI bus driver if the board we're being run on has PCIe. The two are mutually-exclusive on Octeon. Modified: head/sys/mips/cavium/octopci.c Modified: head/sys/mips/cavium/octopci.c == --- head/sys/mips/cavium/octopci.c Wed Nov 3 23:16:35 2010 (r214765) +++ head/sys/mips/cavium/octopci.c Wed Nov 3 23:29:52 2010 (r214766) @@ -108,6 +108,8 @@ octopci_probe(device_t dev) { if (device_get_unit(dev) != 0) return (ENXIO); + if (octeon_has_feature(OCTEON_FEATURE_PCIE)) + return (ENXIO); /* XXX Check sysinfo flag. */ device_set_desc(dev, "Cavium Octeon PCI bridge"); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r214961 - head/usr.bin/yacc
David, On Sun, Nov 7, 2010 at 15:22, David E. O'Brien wrote: > Author: obrien > Date: Sun Nov 7 23:22:42 2010 > New Revision: 214961 > URL: http://svn.freebsd.org/changeset/base/214961 > > Log: > Directly use memory allocation functions and remove needless casts in > their usage. Also use associated modern types instead of k&r ones. You do know that changing skeleton.c affects the generated files, right? I'm wondering if whatever sed script you're judiciously-applying knows that. C++ does not do implicit conversions from "void *" so you need the casts on the mallocs there. With a C++ compiler: y.tab.c:116: error: invalid conversion from 'void*' to 'short int*' y.tab.c:122: error: invalid conversion from 'void*' to 'YYSTYPE*' Please back out the changes to the skeleton. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215014 - head/sys/contrib/octeon-sdk
Author: jmallett Date: Mon Nov 8 21:22:55 2010 New Revision: 215014 URL: http://svn.freebsd.org/changeset/base/215014 Log: o) Recognize the Lanner MR-730. o) Fix enumeration of PHY addresses on the MR-955. o) Parse link state for the MR-730 using the Broadcom PHY support in the SDK. It's not clear that this is entirely-correct, but it seems to work. Since this board uses a BCM5482S, this may mean that we work correctly for copper but not SFI, which is untested. Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper.c Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h == --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Mon Nov 8 20:57:08 2010 (r215013) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Mon Nov 8 21:22:55 2010 (r215014) @@ -193,6 +193,9 @@ enum cvmx_board_types_enum { CVMX_BOARD_TYPE_CUST_GCT108 = 10012, CVMX_BOARD_TYPE_CUST_AGS109 = 10013, CVMX_BOARD_TYPE_CUST_GCT110 = 10014, +#if defined(OCTEON_VENDOR_LANNER) +CVMX_BOARD_TYPE_CUST_LANNER_MR730= 10021, +#endif CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 2, /* Set aside a range for customer private use. The SDK won't @@ -272,6 +275,9 @@ static inline const char *cvmx_board_typ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT108) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS109) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT110) +#if defined(OCTEON_VENDOR_LANNER) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR730) +#endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX) /* Customer private range */ Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c == --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov 8 20:57:08 2010(r215013) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Mon Nov 8 21:22:55 2010(r215014) @@ -114,9 +114,6 @@ int cvmx_helper_board_get_mii_address(in case CVMX_BOARD_TYPE_EBT5800: case CVMX_BOARD_TYPE_THUNDER: case CVMX_BOARD_TYPE_NICPRO2: -#if defined(OCTEON_VENDOR_LANNER) - case CVMX_BOARD_TYPE_CUST_LANNER_MR955: -#endif /* Interface 0 is SPI4, interface 1 is RGMII */ if ((ipd_port >= 16) && (ipd_port < 20)) return ipd_port - 16; @@ -180,6 +177,15 @@ int cvmx_helper_board_get_mii_address(in /* Private vendor-defined boards. */ #if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR955: + /* Interface 1 is 12 BCM5482S PHYs. */ +if ((ipd_port >= 16) && (ipd_port < 28)) +return ipd_port - 16; + return -1; + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: +if ((ipd_port >= 0) && (ipd_port < 4)) +return ipd_port; + return -1; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: /* Port 0 is a Marvell 88E6161 switch, ports 1 and 2 are Marvell 88E interfaces. */ @@ -291,6 +297,10 @@ cvmx_helper_link_info_t __cvmx_helper_bo break; /* Private vendor-defined boards. */ #if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + /* Ports are BCM5482S */ + is_broadcom_phy = 1; + break; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: /* Port 0 connects to the switch */ if (ipd_port == 0) Modified: head/sys/contrib/octeon-sdk/cvmx-helper.c == --- head/sys/contrib/octeon-sdk/cvmx-helper.c Mon Nov 8 20:57:08 2010 (r215013) +++ head/sys/contrib/octeon-sdk/cvmx-helper.c Mon Nov 8 21:22:55 2010 (r215014) @@ -105,6 +105,8 @@ int cvmx_helper_get_number_of_interfaces #if defined(OCTEON_VENDOR_LANNER) case CVMX_BOARD_TYPE_CUST_LANNER_MR955: return 2; + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + return 1; #endif default: break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215015 - head/sys/dev/mii
Author: jmallett Date: Mon Nov 8 21:23:28 2010 New Revision: 215015 URL: http://svn.freebsd.org/changeset/base/215015 Log: Recognize the BCM5482S. Modified: head/sys/dev/mii/brgphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/brgphy.c == --- head/sys/dev/mii/brgphy.c Mon Nov 8 21:22:55 2010(r215014) +++ head/sys/dev/mii/brgphy.c Mon Nov 8 21:23:28 2010(r215015) @@ -132,6 +132,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM, BCM5754), MII_PHY_DESC(xxBROADCOM, BCM5780), MII_PHY_DESC(xxBROADCOM, BCM5708C), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5482S), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5755), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5787), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5708S), Modified: head/sys/dev/mii/miidevs == --- head/sys/dev/mii/miidevsMon Nov 8 21:22:55 2010(r215014) +++ head/sys/dev/mii/miidevsMon Nov 8 21:23:28 2010(r215015) @@ -145,6 +145,7 @@ model xxBROADCOM BCM54K20x002e BCM54K2 model xxBROADCOM BCM5714 0x0034 BCM5714 10/100/1000baseTX PHY model xxBROADCOM BCM5780 0x0035 BCM5780 10/100/1000baseTX PHY model xxBROADCOM BCM5708C 0x0036 BCM5708C 10/100/1000baseTX PHY +model xxBROADCOM_ALT1 BCM5482S 0x000b BCM5482S Dual-Port 10/100/1000baseX/FX PHY model xxBROADCOM_ALT1 BCM5755 0x000c BCM5755 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5787 0x000e BCM5787 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5708S 0x0015 BCM5708S 1000/2500BaseSX PHY ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215021 - head/sys/kern
Author: jmallett Date: Mon Nov 8 22:12:25 2010 New Revision: 215021 URL: http://svn.freebsd.org/changeset/base/215021 Log: Use macros rather than inline functions to lock and unlock mutexes, so that line number information is preserved in witness. Reviewed by: jhb Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c == --- head/sys/kern/subr_taskqueue.c Mon Nov 8 22:10:51 2010 (r215020) +++ head/sys/kern/subr_taskqueue.c Mon Nov 8 22:12:25 2010 (r215021) @@ -68,23 +68,21 @@ struct taskqueue { #defineTQ_FLAGS_BLOCKED(1 << 1) #defineTQ_FLAGS_PENDING(1 << 2) -static __inline void -TQ_LOCK(struct taskqueue *tq) -{ - if (tq->tq_spin) - mtx_lock_spin(&tq->tq_mutex); - else - mtx_lock(&tq->tq_mutex); -} - -static __inline void -TQ_UNLOCK(struct taskqueue *tq) -{ - if (tq->tq_spin) - mtx_unlock_spin(&tq->tq_mutex); - else - mtx_unlock(&tq->tq_mutex); -} +#defineTQ_LOCK(tq) \ + do {\ + if ((tq)->tq_spin) \ + mtx_lock_spin(&(tq)->tq_mutex); \ + else\ + mtx_lock(&(tq)->tq_mutex); \ + } while (0) + +#defineTQ_UNLOCK(tq) \ + do {\ + if ((tq)->tq_spin) \ + mtx_unlock_spin(&(tq)->tq_mutex); \ + else\ + mtx_unlock(&(tq)->tq_mutex);\ + } while (0) static __inline int TQ_SLEEP(struct taskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215957 - head/sys/mips/cavium/octe
Author: jmallett Date: Sat Nov 27 22:42:41 2010 New Revision: 215957 URL: http://svn.freebsd.org/changeset/base/215957 Log: Use if_transmit to avoid ifq locking in transmit path. Modified: head/sys/mips/cavium/octe/octe.c Modified: head/sys/mips/cavium/octe/octe.c == --- head/sys/mips/cavium/octe/octe.cSat Nov 27 21:51:39 2010 (r215956) +++ head/sys/mips/cavium/octe/octe.cSat Nov 27 22:42:41 2010 (r215957) @@ -90,7 +90,7 @@ static intocte_miibus_writereg(device_ static voidocte_init(void *); static voidocte_stop(void *); -static voidocte_start(struct ifnet *); +static int octe_transmit(struct ifnet *, struct mbuf *); static int octe_mii_medchange(struct ifnet *); static voidocte_mii_medstat(struct ifnet *, struct ifmediareq *); @@ -185,7 +185,6 @@ octe_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | IFF_ALLMULTI; ifp->if_init = octe_init; ifp->if_ioctl = octe_ioctl; - ifp->if_start = octe_start; priv->if_flags = ifp->if_flags; @@ -198,6 +197,8 @@ octe_attach(device_t dev) ether_ifattach(ifp, priv->mac); + ifp->if_transmit = octe_transmit; + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_HWCSUM; ifp->if_capenable = ifp->if_capabilities; @@ -317,38 +318,26 @@ octe_stop(void *arg) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } -static void -octe_start(struct ifnet *ifp) +static int +octe_transmit(struct ifnet *ifp, struct mbuf *m) { cvm_oct_private_t *priv; - struct mbuf *m; int error; priv = ifp->if_softc; - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) - return; - - OCTE_TX_LOCK(priv); - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); - - OCTE_TX_UNLOCK(priv); - - if (priv->queue != -1) { - error = cvm_oct_xmit(m, ifp); - } else { - error = cvm_oct_xmit_pow(m, ifp); - } - - if (error != 0) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - return; - } + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) { + m_freem(m); + return (0); + } - OCTE_TX_LOCK(priv); + if (priv->queue != -1) { + error = cvm_oct_xmit(m, ifp); + } else { + error = cvm_oct_xmit_pow(m, ifp); } - OCTE_TX_UNLOCK(priv); + return (error); } static int ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215959 - head/sys/mips/cavium/octe
Author: jmallett Date: Sun Nov 28 00:26:08 2010 New Revision: 215959 URL: http://svn.freebsd.org/changeset/base/215959 Log: Remove unused and broken code to implement POW send and POW-only devices; a separate POW driver makes more sense, generally. Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/cavium/octe/ethernet-tx.h head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octe/octe.c Modified: head/sys/mips/cavium/octe/ethernet-common.c == --- head/sys/mips/cavium/octe/ethernet-common.c Sat Nov 27 23:48:53 2010 (r215958) +++ head/sys/mips/cavium/octe/ethernet-common.c Sun Nov 28 00:26:08 2010 (r215959) @@ -46,9 +46,6 @@ __FBSDID("$FreeBSD$"); extern int octeon_is_simulation(void); extern cvmx_bootinfo_t *octeon_bootinfo; -extern int pow_send_group; -extern int always_use_pow; -extern char pow_send_list[]; /** @@ -239,11 +236,6 @@ int cvm_oct_common_init(struct ifnet *if octeon_bootinfo->mac_addr_base[5] + count}; cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - /* Force the interface to use the POW send if always_use_pow was - specified or it is in the pow send list */ - if ((pow_send_group != -1) && (always_use_pow || strstr(pow_send_list, if_name(ifp - priv->queue = -1; - ifp->if_mtu = ETHERMTU; count++; Modified: head/sys/mips/cavium/octe/ethernet-tx.c == --- head/sys/mips/cavium/octe/ethernet-tx.c Sat Nov 27 23:48:53 2010 (r215958) +++ head/sys/mips/cavium/octe/ethernet-tx.c Sun Nov 28 00:26:08 2010 (r215959) @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); #define GET_MBUF_QOS(m) 0 #endif -extern int pow_send_group; - /** * Packet transmit @@ -261,132 +259,6 @@ int cvm_oct_xmit(struct mbuf *m, struct /** - * Packet transmit to the POW - * - * @param mPacket to send - * @param devDevice info structure - * @return Always returns zero - */ -int cvm_oct_xmit_pow(struct mbuf *m, struct ifnet *ifp) -{ - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - char *packet_buffer; - char *copy_location; - - /* Get a work queue entry */ - cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); - if (__predict_false(work == NULL)) { - DEBUGPRINT("%s: Failed to allocate a work queue entry\n", if_name(ifp)); - ifp->if_oerrors++; - m_freem(m); - return 0; - } - - /* Get a packet buffer */ - packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL); - if (__predict_false(packet_buffer == NULL)) { - DEBUGPRINT("%s: Failed to allocate a packet buffer\n", - if_name(ifp)); - cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1)); - ifp->if_oerrors++; - m_freem(m); - return 0; - } - - /* Calculate where we need to copy the data to. We need to leave 8 bytes - for a next pointer (unused). We also need to include any configure - skip. Then we need to align the IP packet src and dest into the same - 64bit word. The below calculation may add a little extra, but that - doesn't hurt */ - copy_location = packet_buffer + sizeof(uint64_t); - copy_location += ((CVMX_HELPER_FIRST_MBUFF_SKIP+7)&0xfff8) + 6; - - /* We have to copy the packet since whoever processes this packet - will free it to a hardware pool. We can't use the trick of - counting outstanding packets like in cvm_oct_xmit */ - m_copydata(m, 0, m->m_pkthdr.len, copy_location); - - /* Fill in some of the work queue fields. We may need to add more - if the software at the other end needs them */ -#if 0 - work->hw_chksum = m->csum; -#endif - work->len = m->m_pkthdr.len; - work->ipprt = priv->port; - work->qos = priv->port & 0x7; - work->grp = pow_send_group; - work->tag_type = CVMX_HELPER_INPUT_TAG_TYPE; - work->tag = pow_send_group; /* FIXME */ - work->word2.u64 = 0;/* Default to zero. Sets of zero later are commented out */ - work->word2.s.bufs = 1; - work->packet_ptr.u64 = 0; - work->packet_ptr.s.addr = cvmx_ptr_to_phys(copy_location); - work->packet_ptr.s.pool = CVMX_FPA_PACKET_POOL; - work->packet_ptr.s.size = CVMX_FPA_PACKET_POOL_SIZE; - work->packet_ptr.s.back = (copy_location - packet_buffer)>>7; - - panic("%s: POW transmit not quite implemented yet.", __func__); -#if 0 - if (m->protocol == htons(ETH_P_IP)) { - work->word2.s.ip_offset = 14; -
svn commit: r215971 - head/sys/mips/include
Author: jmallett Date: Sun Nov 28 04:07:45 2010 New Revision: 215971 URL: http://svn.freebsd.org/changeset/base/215971 Log: Set MACHINE_ARCH based on ABI and endianness. Reviewed by: imp Modified: head/sys/mips/include/param.h Modified: head/sys/mips/include/param.h == --- head/sys/mips/include/param.h Sun Nov 28 03:41:32 2010 (r215970) +++ head/sys/mips/include/param.h Sun Nov 28 04:07:45 2010 (r215971) @@ -57,7 +57,23 @@ #defineMACHINE "mips" #endif #ifndef MACHINE_ARCH -#defineMACHINE_ARCH"mips" +#if _BYTE_ORDER == _BIG_ENDIAN +#ifdef __mips_n64 +#defineMACHINE_ARCH"mips64eb" +#elif defined(__mips_n32) +#defineMACHINE_ARCH"mipsn32eb" +#else +#defineMACHINE_ARCH"mipseb" +#endif +#else +#ifdef __mips_n64 +#defineMACHINE_ARCH"mips64el" +#elif defined(__mips_n32) +#defineMACHINE_ARCH"mipsn32el" +#else +#defineMACHINE_ARCH"mipsel" +#endif +#endif #endif /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215974 - head/sys/mips/cavium/octe
Author: jmallett Date: Sun Nov 28 05:57:24 2010 New Revision: 215974 URL: http://svn.freebsd.org/changeset/base/215974 Log: 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? Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-common.h head/sys/mips/cavium/octe/ethernet-defines.h head/sys/mips/cavium/octe/ethernet-mdio.c head/sys/mips/cavium/octe/ethernet-mem.c head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/ethernet-common.c == --- head/sys/mips/cavium/octe/ethernet-common.c Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet-common.c Sun Nov 28 05:57:24 2010 (r215974) @@ -49,51 +49,6 @@ extern cvmx_bootinfo_t *octeon_bootinfo; /** - * Get the low level ethernet statistics - * - * @param devDevice to get the statistics from - * @return Pointer to the statistics - */ -#if 0 -static struct ifnet_stats *cvm_oct_common_get_stats(struct ifnet *ifp) -{ - cvmx_pip_port_status_t rx_status; - cvmx_pko_port_status_t tx_status; - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - - if (priv->port < CVMX_PIP_NUM_INPUT_PORTS) { - if (octeon_is_simulation()) { - /* The simulator doesn't support statistics */ - memset(&rx_status, 0, sizeof(rx_status)); - memset(&tx_status, 0, sizeof(tx_status)); - } else { - cvmx_pip_get_port_status(priv->port, 1, &rx_status); - cvmx_pko_get_port_status(priv->port, 1, &tx_status); - } - - priv->stats.rx_packets += rx_status.inb_packets; - priv->stats.tx_packets += tx_status.packets; - priv->stats.rx_bytes+= rx_status.inb_octets; - priv->stats.tx_bytes+= tx_status.octets; - priv->stats.multicast += rx_status.multicast_packets; - priv->stats.rx_crc_errors += rx_status.inb_errors; - priv->stats.rx_frame_errors += rx_status.fcs_align_err_packets; - - /* The drop counter must be incremented atomically since the RX - tasklet also increments it */ -#ifdef CONFIG_64BIT - cvmx_atomic_add64_nosync(&priv->stats.rx_dropped, rx_status.dropped_packets); -#else - cvmx_atomic_add32_nosync((int32_t *)&priv->stats.rx_dropped, rx_status.dropped_packets); -#endif - } - - return &priv->stats; -} -#endif - - -/** * Set the multicast list. Currently unimplemented. * * @param devDevice to work on @@ -219,6 +174,67 @@ int cvm_oct_common_change_mtu(struct ifn /** + * Enable port. + */ +int cvm_oct_common_open(struct ifnet *ifp) +{ + cvmx_gmxx_prtx_cfg_t gmx_cfg; + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + int interface = INTERFACE(priv->port); + int index = INDEX(priv->port); + cvmx_helper_link_info_t link_info; + + gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); + gmx_cfg.s.en = 1; + cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); + +if (!octeon_is_simulation()) { + link_info = cvmx_helper_link_get(priv->port); + if (!link_info.s.link_up) + if_link_state_change(ifp, LINK_STATE_DOWN); +else + if_link_state_change(ifp, LINK_STATE_UP); +} + + return 0; +} + + +/** + * Disable port. + */ +int cvm_oct_common_stop(struct ifnet *ifp) +{ + cvmx_gmxx_prtx_cfg_t gmx_cfg; + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + int interface = INTERFACE(priv->port); + int index = INDEX(priv->port); + + gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); + gmx_cfg.s.en = 0; + cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); + return 0; +} + +/** + * Poll for link status change. + */ +void cvm_oct_common_poll(struct ifnet *ifp) +{ + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + cvmx_helper_link_info_t link_info; + + link_info = cvmx_helper_link_get(priv->port); + if (link_info.u64 == priv->link_info) + return; + + link_info = cvmx_helper_link_
svn commit: r215975 - svnadmin/conf
Author: jmallett Date: Sun Nov 28 06:18:58 2010 New Revision: 215975 URL: http://svn.freebsd.org/changeset/base/215975 Log: Raise my limit for Octeon SDK 2.0 import. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf == --- svnadmin/conf/sizelimit.confSun Nov 28 05:57:24 2010 (r215974) +++ svnadmin/conf/sizelimit.confSun Nov 28 06:18:58 2010 (r215975) @@ -32,3 +32,4 @@ gonzo kmacy jb jeff +jmallett ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215976 - in vendor-sys/octeon-sdk/dist: . cvmx-malloc
Author: jmallett Date: Sun Nov 28 06:20:41 2010 New Revision: 215976 URL: http://svn.freebsd.org/changeset/base/215976 Log: Import Cavium Octeon SDK 2.0 Simple Executive from cnusers.org. Added: vendor-sys/octeon-sdk/dist/cvmx-agl-defs.h vendor-sys/octeon-sdk/dist/cvmx-app-hotplug.c vendor-sys/octeon-sdk/dist/cvmx-app-hotplug.h vendor-sys/octeon-sdk/dist/cvmx-asx0-defs.h vendor-sys/octeon-sdk/dist/cvmx-asxx-defs.h vendor-sys/octeon-sdk/dist/cvmx-ciu-defs.h vendor-sys/octeon-sdk/dist/cvmx-clock.c vendor-sys/octeon-sdk/dist/cvmx-clock.h vendor-sys/octeon-sdk/dist/cvmx-crypto.c vendor-sys/octeon-sdk/dist/cvmx-crypto.h vendor-sys/octeon-sdk/dist/cvmx-dbg-defs.h vendor-sys/octeon-sdk/dist/cvmx-debug-handler.S vendor-sys/octeon-sdk/dist/cvmx-debug-remote.c vendor-sys/octeon-sdk/dist/cvmx-debug-uart.c vendor-sys/octeon-sdk/dist/cvmx-debug.c vendor-sys/octeon-sdk/dist/cvmx-debug.h vendor-sys/octeon-sdk/dist/cvmx-dfa-defs.h vendor-sys/octeon-sdk/dist/cvmx-dfm-defs.h vendor-sys/octeon-sdk/dist/cvmx-dpi-defs.h vendor-sys/octeon-sdk/dist/cvmx-error-custom.c vendor-sys/octeon-sdk/dist/cvmx-error-custom.h vendor-sys/octeon-sdk/dist/cvmx-error-init-cn30xx.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn31xx.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn38xx.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn38xxp2.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn50xx.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn52xx.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn52xxp1.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn56xx.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn56xxp1.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn58xx.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn58xxp1.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn63xx.c vendor-sys/octeon-sdk/dist/cvmx-error-init-cn63xxp1.c vendor-sys/octeon-sdk/dist/cvmx-error.c vendor-sys/octeon-sdk/dist/cvmx-error.h vendor-sys/octeon-sdk/dist/cvmx-fpa-defs.h vendor-sys/octeon-sdk/dist/cvmx-gmxx-defs.h vendor-sys/octeon-sdk/dist/cvmx-gpio-defs.h vendor-sys/octeon-sdk/dist/cvmx-helper-jtag.c vendor-sys/octeon-sdk/dist/cvmx-helper-jtag.h vendor-sys/octeon-sdk/dist/cvmx-helper-srio.c vendor-sys/octeon-sdk/dist/cvmx-helper-srio.h vendor-sys/octeon-sdk/dist/cvmx-iob-defs.h vendor-sys/octeon-sdk/dist/cvmx-ipd-defs.h vendor-sys/octeon-sdk/dist/cvmx-ixf18201.c vendor-sys/octeon-sdk/dist/cvmx-ixf18201.h vendor-sys/octeon-sdk/dist/cvmx-key-defs.h vendor-sys/octeon-sdk/dist/cvmx-l2c-defs.h vendor-sys/octeon-sdk/dist/cvmx-l2d-defs.h vendor-sys/octeon-sdk/dist/cvmx-l2t-defs.h vendor-sys/octeon-sdk/dist/cvmx-led-defs.h vendor-sys/octeon-sdk/dist/cvmx-lmcx-defs.h vendor-sys/octeon-sdk/dist/cvmx-mio-defs.h vendor-sys/octeon-sdk/dist/cvmx-mixx-defs.h vendor-sys/octeon-sdk/dist/cvmx-mpi-defs.h vendor-sys/octeon-sdk/dist/cvmx-ndf-defs.h vendor-sys/octeon-sdk/dist/cvmx-npei-defs.h vendor-sys/octeon-sdk/dist/cvmx-npi-defs.h vendor-sys/octeon-sdk/dist/cvmx-pci-defs.h vendor-sys/octeon-sdk/dist/cvmx-pcieepx-defs.h vendor-sys/octeon-sdk/dist/cvmx-pciercx-defs.h vendor-sys/octeon-sdk/dist/cvmx-pcm-defs.h vendor-sys/octeon-sdk/dist/cvmx-pcmx-defs.h vendor-sys/octeon-sdk/dist/cvmx-pcsx-defs.h vendor-sys/octeon-sdk/dist/cvmx-pcsxx-defs.h vendor-sys/octeon-sdk/dist/cvmx-pemx-defs.h vendor-sys/octeon-sdk/dist/cvmx-pescx-defs.h vendor-sys/octeon-sdk/dist/cvmx-pexp-defs.h vendor-sys/octeon-sdk/dist/cvmx-pip-defs.h vendor-sys/octeon-sdk/dist/cvmx-pko-defs.h vendor-sys/octeon-sdk/dist/cvmx-pow-defs.h vendor-sys/octeon-sdk/dist/cvmx-power-throttle.c vendor-sys/octeon-sdk/dist/cvmx-power-throttle.h vendor-sys/octeon-sdk/dist/cvmx-rad-defs.h vendor-sys/octeon-sdk/dist/cvmx-rnm-defs.h vendor-sys/octeon-sdk/dist/cvmx-shmem.c vendor-sys/octeon-sdk/dist/cvmx-shmem.h vendor-sys/octeon-sdk/dist/cvmx-sim-magic.h vendor-sys/octeon-sdk/dist/cvmx-sli-defs.h vendor-sys/octeon-sdk/dist/cvmx-smi-defs.h vendor-sys/octeon-sdk/dist/cvmx-smix-defs.h vendor-sys/octeon-sdk/dist/cvmx-spx0-defs.h vendor-sys/octeon-sdk/dist/cvmx-spxx-defs.h vendor-sys/octeon-sdk/dist/cvmx-srio.c vendor-sys/octeon-sdk/dist/cvmx-srio.h vendor-sys/octeon-sdk/dist/cvmx-sriomaintx-defs.h vendor-sys/octeon-sdk/dist/cvmx-sriox-defs.h vendor-sys/octeon-sdk/dist/cvmx-srxx-defs.h vendor-sys/octeon-sdk/dist/cvmx-stxx-defs.h vendor-sys/octeon-sdk/dist/cvmx-tim-defs.h vendor-sys/octeon-sdk/dist/cvmx-tlb.c vendor-sys/octeon-sdk/dist/cvmx-tlb.h vendor-sys/octeon-sdk/dist/cvmx-tra-defs.h vendor-sys/octeon-sdk/dist/cvmx-uahcx-defs.h vendor-sys/octeon-sdk/dist/cvmx-uart.c vendor-sys/octeon-sdk/dist/cvmx-uctlx-defs.h vendor-sys/octeon-sdk/dist/cvmx-usbcx-defs.h vendor-sys/octeon-sdk/dist/cvmx-usbd.c vendor-sys/octeon-sdk/dist/cvmx-usbd.h vendor-sys/octeon-sdk/dist/cvmx-usbnx-defs.h vendor-sys/octeon-sdk/dist/cvmx-zip-defs.h vendor-sys/octeon-sdk/dist/octeon-boot-info.
svn commit: r215977 - vendor-sys/octeon-sdk/2.0.0
Author: jmallett Date: Sun Nov 28 06:24:56 2010 New Revision: 215977 URL: http://svn.freebsd.org/changeset/base/215977 Log: Tag Cavium Octeon SDK 2.0 Simple Executive. Added: vendor-sys/octeon-sdk/2.0.0/ - copied from r215976, vendor-sys/octeon-sdk/dist/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215978 - svnadmin/conf
Author: jmallett Date: Sun Nov 28 06:25:17 2010 New Revision: 215978 URL: http://svn.freebsd.org/changeset/base/215978 Log: Back to normal limit. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf == --- svnadmin/conf/sizelimit.confSun Nov 28 06:24:56 2010 (r215977) +++ svnadmin/conf/sizelimit.confSun Nov 28 06:25:17 2010 (r215978) @@ -32,4 +32,3 @@ gonzo kmacy jb jeff -jmallett ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215988 - head/sys/conf
Author: jmallett Date: Sun Nov 28 08:09:20 2010 New Revision: 215988 URL: http://svn.freebsd.org/changeset/base/215988 Log: Bump up MIPS limits once again; the new Cavium Octeon SDK requires even higher limits. I'd rather disable the warning and keep the limits at a sane level, but for now they'll be ridiculously-high. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk == --- head/sys/conf/kern.pre.mk Sun Nov 28 07:29:56 2010(r215987) +++ head/sys/conf/kern.pre.mk Sun Nov 28 08:09:20 2010(r215988) @@ -100,8 +100,9 @@ CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 .else # XXX Actually a gross hack just for Octeon because of the Simple Executive. -CFLAGS+= --param inline-unit-growth=1000 +CFLAGS+= --param inline-unit-growth=1 CFLAGS+= --param large-function-growth=10 +CFLAGS+= --param max-inline-insns-single=1 .endif .endif WERROR?= -Werror ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r216064 - head/sys/mips/cavium/octe
Author: jmallett Date: Mon Nov 29 21:04:00 2010 New Revision: 216064 URL: http://svn.freebsd.org/changeset/base/216064 Log: 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 Modified: head/sys/mips/cavium/octe/ethernet-tx.c Modified: head/sys/mips/cavium/octe/ethernet-tx.c == --- head/sys/mips/cavium/octe/ethernet-tx.c Mon Nov 29 20:43:06 2010 (r216063) +++ head/sys/mips/cavium/octe/ethernet-tx.c Mon Nov 29 21:04:00 2010 (r216064) @@ -143,6 +143,7 @@ int cvm_oct_xmit(struct mbuf *m, struct /* Build the PKO command */ pko_command.u64 = 0; pko_command.s.segs = 1; + pko_command.s.dontfree = 1; /* Do not put this buffer into the FPA. */ work = NULL; } else { @@ -164,6 +165,7 @@ int cvm_oct_xmit(struct mbuf *m, struct /* Build the PKO buffer pointer */ hw_buffer.u64 = 0; + hw_buffer.s.i = 1; /* Do not put this buffer into the FPA. */ hw_buffer.s.addr = cvmx_ptr_to_phys(n->m_data); hw_buffer.s.pool = 0; hw_buffer.s.size = n->m_len; @@ -182,12 +184,11 @@ int cvm_oct_xmit(struct mbuf *m, struct pko_command.u64 = 0; pko_command.s.segs = segs; pko_command.s.gather = 1; + pko_command.s.dontfree = 0; /* Put the WQE above back into the FPA. */ } /* Finish building the PKO command */ pko_command.s.n2 = 1; /* Don't pollute L2 with the outgoing packet */ - pko_command.s.dontfree = 1; - pko_command.s.reg0 = priv->fau+qos*4; pko_command.s.reg0 = priv->fau+qos*4; pko_command.s.total_bytes = m->m_pkthdr.len; pko_command.s.size0 = CVMX_FAU_OP_SIZE_32; @@ -200,6 +201,11 @@ int cvm_oct_xmit(struct mbuf *m, struct pko_command.s.ipoffp1 = ETHER_HDR_LEN + 1; } + /* +* XXX +* Could use a different free queue (and different FAU address) per +* core instead of per QoS, to reduce contention here. +*/ IF_LOCK(&priv->tx_free_queue[qos]); if (USE_ASYNC_IOBDMA) { /* Get the number of mbufs in use by the hardware */ @@ -242,8 +248,6 @@ int cvm_oct_xmit(struct mbuf *m, struct /* Pass it to any BPF listeners. */ ETHER_BPF_MTAP(ifp, m); } - if (work != NULL) - cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1)); /* Free mbufs not in use by the hardware */ if (_IF_QLEN(&priv->tx_free_queue[qos]) > in_use) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r216069 - head/sys/mips/cavium
Author: jmallett Date: Tue Nov 30 01:27:54 2010 New Revision: 216069 URL: http://svn.freebsd.org/changeset/base/216069 Log: Display some Octeon 2 features and a feature for distinguishing between PCIe implementations. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Mon Nov 29 22:20:44 2010 (r216068) +++ head/sys/mips/cavium/octeon_machdep.c Tue Nov 30 01:27:54 2010 (r216069) @@ -97,7 +97,9 @@ static const struct octeon_feature_descr { OCTEON_FEATURE_SAAD, "SAAD" }, { OCTEON_FEATURE_ZIP, "ZIP" }, { OCTEON_FEATURE_CRYPTO,"CRYPTO" }, + { OCTEON_FEATURE_DORM_CRYPTO, "DORM_CRYPTO" }, { OCTEON_FEATURE_PCIE, "PCIE" }, + { OCTEON_FEATURE_SRIO, "SRIO" }, { OCTEON_FEATURE_KEY_MEMORY,"KEY_MEMORY" }, { OCTEON_FEATURE_LED_CONTROLLER,"LED_CONTROLLER" }, { OCTEON_FEATURE_TRA, "TRA" }, @@ -107,6 +109,7 @@ static const struct octeon_feature_descr { OCTEON_FEATURE_NO_WPTR, "NO_WPTR" }, { OCTEON_FEATURE_DFA, "DFA" }, { OCTEON_FEATURE_MDIO_CLAUSE_45,"MDIO_CLAUSE_45" }, + { OCTEON_FEATURE_NPEI, "NPEI" }, { 0,NULL } }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r216071 - head/sys/mips/cavium/octe
Author: jmallett Date: Tue Nov 30 07:14:05 2010 New Revision: 216071 URL: http://svn.freebsd.org/changeset/base/216071 Log: 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. Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-common.h head/sys/mips/cavium/octe/ethernet-rgmii.c head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octe/octe.c Modified: head/sys/mips/cavium/octe/ethernet-common.c == --- head/sys/mips/cavium/octe/ethernet-common.c Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/ethernet-common.c Tue Nov 30 07:14:05 2010 (r216071) @@ -188,7 +188,10 @@ int cvm_oct_common_open(struct ifnet *if gmx_cfg.s.en = 1; cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); -if (!octeon_is_simulation()) { + /* +* Set the link state unless we are using MII. +*/ +if (!octeon_is_simulation() && priv->miibus == NULL) { link_info = cvmx_helper_link_get(priv->port); if (!link_info.s.link_up) if_link_state_change(ifp, LINK_STATE_DOWN); @@ -224,6 +227,30 @@ void cvm_oct_common_poll(struct ifnet *i cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; cvmx_helper_link_info_t link_info; + /* +* If this is a simulation, do nothing. +*/ + if (octeon_is_simulation()) + return; + + /* +* If there is a device-specific poll method, use it. +*/ + if (priv->poll != NULL) { + priv->poll(ifp); + return; + } + + /* +* If an MII bus is attached, don't use the Simple Executive's link +* state routines. +*/ + if (priv->miibus != NULL) + return; + + /* +* Use the Simple Executive's link state routines. +*/ link_info = cvmx_helper_link_get(priv->port); if (link_info.u64 == priv->link_info) return; Modified: head/sys/mips/cavium/octe/ethernet-common.h == --- head/sys/mips/cavium/octe/ethernet-common.h Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/ethernet-common.h Tue Nov 30 07:14:05 2010 (r216071) @@ -48,8 +48,6 @@ void cvm_oct_cleanup_module(void); int cvm_oct_rgmii_init(struct ifnet *ifp); void cvm_oct_rgmii_uninit(struct ifnet *ifp); int cvm_oct_sgmii_init(struct ifnet *ifp); -void cvm_oct_sgmii_uninit(struct ifnet *ifp); int cvm_oct_spi_init(struct ifnet *ifp); void cvm_oct_spi_uninit(struct ifnet *ifp); int cvm_oct_xaui_init(struct ifnet *ifp); -void cvm_oct_xaui_uninit(struct ifnet *ifp); Modified: head/sys/mips/cavium/octe/ethernet-rgmii.c == --- head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Nov 30 07:14:05 2010 (r216071) @@ -134,9 +134,11 @@ static void cvm_oct_rgmii_poll(struct if cvmx_write_csr(CVMX_GMXX_RXX_INT_REG(index, interface), gmxx_rxx_int_reg.u64); } - link_info = cvmx_helper_link_autoconf(priv->port); - priv->link_info = link_info.u64; - priv->need_link_update = 1; + if (priv->miibus == NULL) { + link_info = cvmx_helper_link_autoconf(priv->port); + priv->link_info = link_info.u64; + priv->need_link_update = 1; + } mtx_unlock_spin(&global_register_lock); } @@ -206,42 +208,6 @@ static int cvm_oct_rgmii_rml_interrupt(v } -static int cvm_oct_rgmii_open(struct ifnet *ifp) -{ - cvmx_gmxx_prtx_cfg_t gmx_cfg; - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - int interface = INTERFACE(priv->port); - int index = INDEX(priv->port); - cvmx_helper_link_info_t link_info; - - gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); - gmx_cfg.s.en = 1; - cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); - -if (!octeon_is_simulation()) { - link_info = cvmx_helper_link_get(priv->port); - if (!link_info.s.link_up) - if_link_state_change(ifp, LINK_STATE_DOWN); -else - if_link_state_change(ifp, LINK_STATE_UP); -} - - return 0; -} - -static int cvm_oct_rgmii_stop(struct ifnet *ifp) -{ - cvmx_gmxx_prtx_cfg_t gmx_cfg; - cvm_oct_private_t *pri
svn commit: r216092 - head/sys/mips/cavium
Author: jmallett Date: Wed Dec 1 05:24:29 2010 New Revision: 216092 URL: http://svn.freebsd.org/changeset/base/216092 Log: Add interrupt describing and binding to CIU. Modified: head/sys/mips/cavium/ciu.c Modified: head/sys/mips/cavium/ciu.c == --- head/sys/mips/cavium/ciu.c Wed Dec 1 03:51:06 2010(r216091) +++ head/sys/mips/cavium/ciu.c Wed Dec 1 05:24:29 2010(r216092) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -80,13 +81,24 @@ static int ciu_setup_intr(device_t, dev void *, void **); static int ciu_teardown_intr(device_t, device_t, struct resource *, void *); +static int ciu_bind_intr(device_t, device_t, struct resource *, + int); +static int ciu_describe_intr(device_t, device_t, + struct resource *, void *, + const char *); static voidciu_hinted_child(device_t, const char *, int); static voidciu_en0_intr_mask(void *); static voidciu_en0_intr_unmask(void *); +#ifdef SMP +static int ciu_en0_intr_bind(void *, u_char); +#endif static voidciu_en1_intr_mask(void *); static voidciu_en1_intr_unmask(void *); +#ifdef SMP +static int ciu_en1_intr_bind(void *, u_char); +#endif static int ciu_intr(void *); @@ -196,6 +208,7 @@ ciu_setup_intr(device_t bus, device_t ch struct intr_event *event, **eventp; void (*mask_func)(void *); void (*unmask_func)(void *); + int (*bind_func)(void *, u_char); mips_intrcnt_t intrcnt; int error; int irq; @@ -206,16 +219,25 @@ ciu_setup_intr(device_t bus, device_t ch intrcnt = ciu_en0_intrcnt[irq - CIU_IRQ_EN0_BEGIN]; mask_func = ciu_en0_intr_mask; unmask_func = ciu_en0_intr_unmask; +#ifdef SMP + bind_func = ciu_en0_intr_bind; +#endif } else { eventp = &ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN]; intrcnt = ciu_en1_intrcnt[irq - CIU_IRQ_EN1_BEGIN]; mask_func = ciu_en1_intr_mask; unmask_func = ciu_en1_intr_unmask; +#ifdef SMP + bind_func = ciu_en1_intr_bind; +#endif } +#if !defined(SMP) + bind_func = NULL; +#endif if ((event = *eventp) == NULL) { error = intr_event_create(eventp, (void *)(uintptr_t)irq, 0, - irq, mask_func, unmask_func, NULL, NULL, "int%d", irq); + irq, mask_func, unmask_func, NULL, bind_func, "int%d", irq); if (error != 0) return (error); @@ -245,6 +267,50 @@ ciu_teardown_intr(device_t bus, device_t return (0); } +#ifdef SMP +static int +ciu_bind_intr(device_t bus, device_t child, struct resource *res, int cpu) +{ + struct intr_event *event; + int irq; + + irq = rman_get_start(res); + if (irq <= CIU_IRQ_EN0_END) + event = ciu_en0_intr_events[irq - CIU_IRQ_EN0_BEGIN]; + else + event = ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN]; + + return (intr_event_bind(event, cpu)); +} +#endif + +static int +ciu_describe_intr(device_t bus, device_t child, struct resource *res, + void *cookie, const char *descr) +{ + struct intr_event *event; + mips_intrcnt_t intrcnt; + int error; + int irq; + + irq = rman_get_start(res); + if (irq <= CIU_IRQ_EN0_END) { + event = ciu_en0_intr_events[irq - CIU_IRQ_EN0_BEGIN]; + intrcnt = ciu_en0_intrcnt[irq - CIU_IRQ_EN0_BEGIN]; + } else { + event = ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN]; + intrcnt = ciu_en1_intrcnt[irq - CIU_IRQ_EN1_BEGIN]; + } + + error = intr_event_describe_handler(event, cookie, descr); + if (error != 0) + return (error); + + mips_intrcnt_setname(intrcnt, event->ie_fullname); + + return (0); +} + static void ciu_hinted_child(device_t bus, const char *dname, int dunit) { @@ -275,6 +341,28 @@ ciu_en0_intr_unmask(void *arg) cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2), mask); } +#ifdef SMP +static int +ciu_en0_intr_bind(void *arg, u_char target) +{ + uint64_t mask; + int core; + int irq; + + irq = (uintptr_t)arg; + CPU_FOREACH(core) { + mask = cvmx_read_csr(CVMX_CIU_INTX_EN0(core*2)); + if (core == target) + mask |= 1ull << (irq - CIU_IRQ_EN0_BEGIN); + else + mask &= ~(1ull << (irq - CIU_IRQ_EN0_BEGIN)); +
svn commit: r216476 - in head/sys: contrib/octeon-sdk mips/cavium/octe
Author: jmallett Date: Thu Dec 16 07:20:38 2010 New Revision: 216476 URL: http://svn.freebsd.org/changeset/base/216476 Log: 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. Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c head/sys/contrib/octeon-sdk/cvmx-pcie.c head/sys/mips/cavium/octe/ethernet-common.c Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h == --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Thu Dec 16 05:13:41 2010 (r216475) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Thu Dec 16 07:20:38 2010 (r216476) @@ -223,6 +223,7 @@ enum cvmx_board_types_enum { CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, #if defined(OCTEON_VENDOR_LANNER) CVMX_BOARD_TYPE_CUST_LANNER_MR320= 20002, +CVMX_BOARD_TYPE_CUST_LANNER_MR321X=20007, #endif CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 3, @@ -336,6 +337,7 @@ static inline const char *cvmx_board_typ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) #if defined(OCTEON_VENDOR_LANNER) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR320) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR321X) #endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c == --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Thu Dec 16 05:13:41 2010(r216475) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Thu Dec 16 07:20:38 2010(r216476) @@ -276,6 +276,7 @@ int cvmx_helper_board_get_mii_address(in return ipd_port; return -1; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: /* Port 0 is a Marvell 88E6161 switch, ports 1 and 2 are Marvell 88E interfaces. */ switch (ipd_port) { @@ -417,6 +418,7 @@ cvmx_helper_link_info_t __cvmx_helper_bo is_broadcom_phy = 1; break; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: /* Port 0 connects to the switch */ if (ipd_port == 0) { @@ -860,6 +862,7 @@ cvmx_helper_board_usb_clock_types_t __cv case CVMX_BOARD_TYPE_LANAI2_G: #if defined(OCTEON_VENDOR_LANNER) case CVMX_BOARD_TYPE_CUST_LANNER_MR320: +case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: #endif return USB_CLOCK_TYPE_CRYSTAL_12; } Modified: head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c == --- head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c Thu Dec 16 05:13:41 2010(r216475) +++ head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c Thu Dec 16 07:20:38 2010(r216476) @@ -239,6 +239,7 @@ int __cvmx_helper_rgmii_enable(int inter #if defined(OCTEON_VENDOR_LANNER) switch (cvmx_sysinfo_get()->board_type) { case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: if (port == 0) { cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(port, interface), 4); } else { Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c == --- head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Dec 16 05:13:41 2010 (r216475) +++ head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Dec 16 07:20:38 2010 (r216476) @@ -392,7 +392,16 @@ static int __cvmx_pcie_rc_initialize_lin /* Lane swap needs to be manually enabled for CN52XX */ if (OCTEON_IS_MODEL(OCTEON_CN52XX) && (pcie_port == 1)) { - pescx_ctl_status.s.lane_swp = 1; + switch (cvmx_sysinfo_get()->board_type) + { +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + break; +#endif + default: + pescx_ctl_status.s.lane_swp = 1; + break; + } cvmx_write_csr(CVMX_PESCX_CTL_STATUS(pcie_port),pescx_ctl_status.u64); } Modified: head/sys/mips/cavium/octe/ethernet-common.c == --- head/sys/mips/cavium/octe/ethernet-common.c Thu Dec 16 05:13:41 2010 (r216475) +++ head/sys/mips/cavium/octe/ethernet-common.c Thu Dec 16 07:20:38 2010 (r216476) @@ -294,6 +294,7 @@ int cvm_oct_common_init(struct ifnet *if switch (cvmx_sysinfo_get()->board_type) { #if defined(OCTEON_VENDOR_LANNER) case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: if (priv->phy_id == 16) cvm_oct_mv88e61xx_setup_device(i
Re: svn commit: r196435 - head/sys/conf
On Sat, Aug 22, 2009 at 22:45, Doug Barton wrote: > Author: dougb > Date: Sun Aug 23 05:45:38 2009 > New Revision: 196435 > URL: http://svn.freebsd.org/changeset/base/196435 > > Log: > The svnversion string is only relevant when newvers.sh is called > during the kernel build process, the other places that call the script > do not make use of that information. So restrict execution of the > svnversion-related code to the kernel build context. This seems to assume that the kernel is always checked out in a directory called 'sys', is that right? That isn't always true in my experience, and I have a bad habit of keeping multiple kernel trees checked out named things like 'sys-head', etc. I could be misreading the code, which gave only constructs I'm not very familiar with for determining whether it's being used for a kernel build. Is it harmful to include the svnversion stuff for other newvers.sh users? Could they just set an environment variable to indicate they want it excluded? Or could you check the environment for kernel build-related variables? Or even set a variable when running newvers.sh for the kernel to explicitly request svnversion inclusion? Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r226018 - head/sys/mips/cavium
Thanks! On Tue, Oct 4, 2011 at 10:49, Marcel Moolenaar wrote: > Author: marcel > Date: Tue Oct 4 17:49:19 2011 > New Revision: 226018 > URL: http://svn.freebsd.org/changeset/base/226018 > > Log: > 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 > > Modified: > head/sys/mips/cavium/asm_octeon.S > head/sys/mips/cavium/octeon_mp.c > > Modified: head/sys/mips/cavium/asm_octeon.S > == > --- head/sys/mips/cavium/asm_octeon.S Tue Oct 4 17:32:01 2011 > (r226017) > +++ head/sys/mips/cavium/asm_octeon.S Tue Oct 4 17:49:19 2011 > (r226018) > @@ -50,12 +50,12 @@ LEAF(octeon_ap_wait) > jal platform_processor_id > nop > > -1: lld t0, octeon_ap_boot > +1: ll t0, octeon_ap_boot > bne v0, t0, 1b > nop > > move t0, zero > - scd t0, octeon_ap_boot > + sc t0, octeon_ap_boot > > beqz t0, 1b > nop > > Modified: head/sys/mips/cavium/octeon_mp.c > == > --- head/sys/mips/cavium/octeon_mp.c Tue Oct 4 17:32:01 2011 > (r226017) > +++ head/sys/mips/cavium/octeon_mp.c Tue Oct 4 17:49:19 2011 > (r226018) > @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); > /* XXX */ > extern cvmx_bootinfo_t *octeon_bootinfo; > > -/* NOTE: this 64-bit mask (and many others) limits MAXCPU to 64 */ > -uint64_t octeon_ap_boot = ~0ULL; > +unsigned octeon_ap_boot = ~0; > > void > platform_ipi_send(int cpuid) > @@ -139,11 +138,11 @@ platform_start_ap(int cpuid) > DELAY(2000); /* Give it a moment to start */ > } > > - if (atomic_cmpset_64(&octeon_ap_boot, ~0, cpuid) == 0) > + if (atomic_cmpset_32(&octeon_ap_boot, ~0, cpuid) == 0) > return (-1); > for (;;) { > DELAY(1000); > - if (atomic_cmpset_64(&octeon_ap_boot, 0, ~0) != 0) > + if (atomic_cmpset_32(&octeon_ap_boot, 0, ~0) != 0) > return (0); > printf("Waiting for cpu%d to start\n", cpuid); > } > ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r216773 - head/sys/mips/cavium
Author: jmallett Date: Tue Dec 28 20:11:54 2010 New Revision: 216773 URL: http://svn.freebsd.org/changeset/base/216773 Log: 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 Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Tue Dec 28 20:02:30 2010 (r216772) +++ head/sys/mips/cavium/octeon_machdep.c Tue Dec 28 20:11:54 2010 (r216773) @@ -287,6 +287,14 @@ octeon_memory_init(void) */ i = 0; while (i < PHYS_AVAIL_ENTRIES) { + /* +* If there is less than 2MB of memory available in 128-byte +* blocks, do not steal any more memory. We need to leave some +* memory for the command queues to be allocated out of. +*/ + if (cvmx_bootmem_available_mem(128) < 2 << 20) + break; + addr = cvmx_bootmem_phy_alloc(1 << 20, phys_end, ~(vm_paddr_t)0, PAGE_SIZE, 0); if (addr == -1) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r216862 - head/sys/mips/mips
Author: jmallett Date: Sat Jan 1 00:20:14 2011 New Revision: 216862 URL: http://svn.freebsd.org/changeset/base/216862 Log: o) When trying to determine whether the pcpu pointer is a managed address, check not just that it is greater than the minimal kernel virtual address, but also that it is less than the maximal kernel virtual address. On n64 kernels, the pcpup comes out of a direct-mapped address that, with an unsigned compare, is rather greater than the minimal kernel virtual address. o) Turn the panic if interrupts are disabled in cpu_idle into a KASSERT since on other architectures it's behind INVARIANTS anyway. o) Add a check that not all interrupts are masked, too. o) Add cpu_idleclock() and cpu_activeclock() use to cpu_idle as is done on other architectures. Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c == --- head/sys/mips/mips/machdep.cFri Dec 31 22:49:13 2010 (r216861) +++ head/sys/mips/mips/machdep.cSat Jan 1 00:20:14 2011 (r216862) @@ -426,8 +426,10 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu pcpu->pc_next_asid = 1; pcpu->pc_asid_generation = 1; #ifdef SMP - if ((vm_offset_t)pcpup >= VM_MIN_KERNEL_ADDRESS) + if ((vm_offset_t)pcpup >= VM_MIN_KERNEL_ADDRESS && + (vm_offset_t)pcpup <= VM_MAX_KERNEL_ADDRESS) { mips_pcpu_tlb_init(pcpu); + } #endif } @@ -483,10 +485,20 @@ spinlock_exit(void) void cpu_idle(int busy) { - if (mips_rd_status() & MIPS_SR_INT_IE) - __asm __volatile ("wait"); - else - panic("ints disabled in idleproc!"); + KASSERT((mips_rd_status() & MIPS_SR_INT_IE) != 0, + ("interrupts disabled in idle process.")); + KASSERT((mips_rd_status() & MIPS_INT_MASK) != 0, + ("all interrupts masked in idle process.")); + + if (!busy) { + critical_enter(); + cpu_idleclock(); + } + __asm __volatile ("wait"); + if (!busy) { + cpu_activeclock(); + critical_exit(); + } } int ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r216946 - head/sys/mips/cavium
Author: jmallett Date: Tue Jan 4 02:11:03 2011 New Revision: 216946 URL: http://svn.freebsd.org/changeset/base/216946 Log: 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. Modified: head/sys/mips/cavium/octeon_mp.c Modified: head/sys/mips/cavium/octeon_mp.c == --- head/sys/mips/cavium/octeon_mp.cTue Jan 4 00:39:56 2011 (r216945) +++ head/sys/mips/cavium/octeon_mp.cTue Jan 4 02:11:03 2011 (r216946) @@ -74,12 +74,12 @@ platform_ipi_intrnum(void) void platform_init_ap(int cpuid) { - unsigned ipi_int_mask, clock_int_mask; + unsigned ciu_int_mask, clock_int_mask, ipi_int_mask; /* * Set the exception base. */ - mips_wr_ebase(0x8000 | cpuid); + mips_wr_ebase(0x8000); /* * Clear any pending IPIs. @@ -92,11 +92,12 @@ platform_init_ap(int cpuid) octeon_ciu_reset(); /* -* Unmask the clock and ipi interrupts. +* Unmask the clock, ipi and ciu interrupts. */ + ciu_int_mask = hard_int_mask(0); clock_int_mask = hard_int_mask(5); ipi_int_mask = hard_int_mask(platform_ipi_intrnum()); - set_intr_mask(ipi_int_mask | clock_int_mask); + set_intr_mask(ciu_int_mask | clock_int_mask | ipi_int_mask); mips_wbflush(); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r216947 - in head/sys/mips: cavium include
Author: jmallett Date: Tue Jan 4 02:33:48 2011 New Revision: 216947 URL: http://svn.freebsd.org/changeset/base/216947 Log: o) Add MIPS_COP_0_EXC_PC accessors to . 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. Modified: head/sys/mips/cavium/octeon_wdog.c head/sys/mips/include/cpufunc.h Modified: head/sys/mips/cavium/octeon_wdog.c == --- head/sys/mips/cavium/octeon_wdog.c Tue Jan 4 02:11:03 2011 (r216946) +++ head/sys/mips/cavium/octeon_wdog.c Tue Jan 4 02:33:48 2011 (r216947) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009, Oleksandr Tymoshenko + * Copyright (c) 2010-2011, Juli Mallett * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,93 +49,98 @@ __FBSDID("$FreeBSD$"); #defineDEFAULT_TIMER_VAL 65535 struct octeon_wdog_softc { - device_t dev; - /* XXX: replace with repscive CVMX_ constant */ - struct resource *irq_res[16]; - void *intr_hdl[16]; - int armed; - int debug; + device_t sc_dev; + struct octeon_wdog_core_softc { + int csc_core; + struct resource *csc_intr; + void *csc_intr_cookie; + } sc_cores[MAXCPU]; + int sc_armed; + int sc_debug; }; extern void octeon_wdog_nmi_handler(void); void octeon_wdog_nmi(void); -static void octeon_watchdog_arm_core(int core, unsigned long timer_val); -static void octeon_watchdog_disarm_core(int core); -static int octeon_wdog_attach(device_t dev); -static void octeon_wdog_identify(driver_t *drv, device_t parent); -static int octeon_wdog_intr(void *);; -static int octeon_wdog_probe(device_t dev); -static void octeon_wdog_setup(struct octeon_wdog_softc *sc, int cpu); -static void octeon_wdog_sysctl(device_t dev); -static void octeon_wdog_watchdog_fn(void *private, u_int cmd, int *error); +static void octeon_watchdog_arm_core(int); +static void octeon_watchdog_disarm_core(int); +static int octeon_wdog_attach(device_t); +static void octeon_wdog_identify(driver_t *, device_t); +static int octeon_wdog_intr(void *); +static int octeon_wdog_probe(device_t); +static void octeon_wdog_setup(struct octeon_wdog_softc *, int); +static void octeon_wdog_sysctl(device_t); +static void octeon_wdog_watchdog_fn(void *, u_int, int *); void -octeon_wdog_nmi() +octeon_wdog_nmi(void) { + int core; - /* XXX: Add something useful here */ - printf("NMI detected\n"); + core = cvmx_get_core_num(); - /* -* This is the end -* Beautiful friend + printf("cpu%u: NMI detected\n", core); + printf("cpu%u: Exception PC: %p\n", core, (void *)mips_rd_excpc()); + printf("cpu%u: status %#x cause %#x\n", core, mips_rd_status(), mips_rd_cause()); + + /* +* This is the end +* Beautiful friend * * Just wait for Soft Reset to come and take us */ for (;;) - ; + continue; } -static void -octeon_watchdog_arm_core(int core, unsigned long timer_val) +static void +octeon_watchdog_arm_core(int core) { cvmx_ciu_wdogx_t ciu_wdog; /* Poke it! */ cvmx_write_csr(CVMX_CIU_PP_POKEX(core), 1); + /* +* XXX +* Perhaps if KDB is enabled, we should use mode=2 and drop into the +* debugger on NMI? +* +* XXX +* Timer should be calculated based on CPU frquency +*/ ciu_wdog.u64 = 0; - ciu_wdog.s.len = timer_val; + ciu_wdog.s.len = DEFAULT_TIMER_VAL; ciu_wdog.s.mode = 3; cvmx_write_csr(CVMX_CIU_WDOGX(core), ciu_wdog.u64); } -static void +static void octeon_watchdog_disarm_core(int core) { cvmx_write_csr(CVMX_CIU_WDOGX(core), 0); } - - static void octeon_wdog_watchdog_fn(void *private, u_int cmd, int *error) { struct octeon_wdog_softc *sc = private; - uint64_t timer_val = 0; + int core; cmd &= WD_INTERVAL; - if (sc->debug) - device_printf(sc->dev, "octeon_wdog_watchdog_fn: cmd: %x\n", cmd); + if (sc->sc_debug) + device_printf(sc->sc_dev, "%s: cmd: %x\n", __func__, cmd); if (cmd > 0) { - if (sc->debug) - device_printf(sc->dev, "octeon_wdog_watchdog_fn: programming timer: %jx\n", (uintmax_t) timer_val); - /* -* XXX: This should be done for every core and with value -* calculated based on CPU frquency -*/ - octeon_watchdog_arm_core(cvmx_get_core_num(), DEFAULT_TIMER_VAL); - sc->armed = 1;
svn commit: r216969 - head/sys/mips/conf
Author: jmallett Date: Tue Jan 4 19:09:05 2011 New Revision: 216969 URL: http://svn.freebsd.org/changeset/base/216969 Log: Remove OCTEON1-32. Since moving to the Cavium SDK, we've lost our support for running an o32 kernel safely, and would have to add interrupt disabling and reenabling to a bunch of macros in the Simple Executive sources to support it. The only reason one would run an o32 kernel on Octeon would be to run o32 world, which is better worked towards by adding o32 binary compatibility to n64 kernels along with, eventually, supporting multilib systems so o32 binaries can run alongside n32 and n64 ones. Discussed with: imp Deleted: head/sys/mips/conf/OCTEON1-32 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r216972 - head/sys/mips/include
Author: jmallett Date: Tue Jan 4 19:32:03 2011 New Revision: 216972 URL: http://svn.freebsd.org/changeset/base/216972 Log: Correct an 8-year-old typo which reliably leads to typo after typo today: The macros here for generating coprocessor 0 accessors are named like: MIPS_RDRW32_COP0 That macro would produce mips_rd_() and mips_wr_() inlines to access the specified register by name from C. The problem is that the R and the W were swapped in the macros originally; it was meant to be named RDWR because it generated mips_rd_* and mips_wr_* functions, but was instead spelled RDRW, which nobody should be expected to get right by anything other than copy and paste. It's too many consonants in a row to keep straight anyway, so just prefer e.g.: MIPS_RW32_COP0 While here, add a missing #undef. Modified: head/sys/mips/include/cpufunc.h Modified: head/sys/mips/include/cpufunc.h == --- head/sys/mips/include/cpufunc.h Tue Jan 4 19:26:11 2011 (r216971) +++ head/sys/mips/include/cpufunc.h Tue Jan 4 19:32:03 2011 (r216972) @@ -114,7 +114,7 @@ mips_write_membar(void) * ABI checks. */ #if defined(__mips_n32) || defined(__mips_n64) -#defineMIPS_RDRW64_COP0(n,r) \ +#defineMIPS_RW64_COP0(n,r) \ static __inline uint64_t \ mips_rd_ ## n (void) \ { \ @@ -137,18 +137,18 @@ mips_wr_ ## n (uint64_t a0) \ } struct __hack #if defined(__mips_n64) -MIPS_RDRW64_COP0(excpc, MIPS_COP_0_EXC_PC); -MIPS_RDRW64_COP0(entrylo0, MIPS_COP_0_TLB_LO0); -MIPS_RDRW64_COP0(entrylo1, MIPS_COP_0_TLB_LO1); -MIPS_RDRW64_COP0(entryhi, MIPS_COP_0_TLB_HI); -MIPS_RDRW64_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); +MIPS_RW64_COP0(excpc, MIPS_COP_0_EXC_PC); +MIPS_RW64_COP0(entrylo0, MIPS_COP_0_TLB_LO0); +MIPS_RW64_COP0(entrylo1, MIPS_COP_0_TLB_LO1); +MIPS_RW64_COP0(entryhi, MIPS_COP_0_TLB_HI); +MIPS_RW64_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); #endif -MIPS_RDRW64_COP0(xcontext, MIPS_COP_0_TLB_XCONTEXT); +MIPS_RW64_COP0(xcontext, MIPS_COP_0_TLB_XCONTEXT); -#undef MIPS_RDRW64_COP0 +#undef MIPS_RW64_COP0 #endif -#defineMIPS_RDRW32_COP0(n,r) \ +#defineMIPS_RW32_COP0(n,r) \ static __inline uint32_t \ mips_rd_ ## n (void) \ { \ @@ -170,7 +170,7 @@ mips_wr_ ## n (uint32_t a0) \ mips_barrier(); \ } struct __hack -#defineMIPS_RDRW32_COP0_SEL(n,r,s) \ +#defineMIPS_RW32_COP0_SEL(n,r,s) \ static __inline uint32_t \ mips_rd_ ## n(void)\ { \ @@ -205,45 +205,46 @@ static __inline void mips_sync_icache (v } #endif -MIPS_RDRW32_COP0(compare, MIPS_COP_0_COMPARE); -MIPS_RDRW32_COP0(config, MIPS_COP_0_CONFIG); -MIPS_RDRW32_COP0_SEL(config1, MIPS_COP_0_CONFIG, 1); -MIPS_RDRW32_COP0_SEL(config2, MIPS_COP_0_CONFIG, 2); -MIPS_RDRW32_COP0_SEL(config3, MIPS_COP_0_CONFIG, 3); -MIPS_RDRW32_COP0(count, MIPS_COP_0_COUNT); -MIPS_RDRW32_COP0(index, MIPS_COP_0_TLB_INDEX); -MIPS_RDRW32_COP0(wired, MIPS_COP_0_TLB_WIRED); -MIPS_RDRW32_COP0(cause, MIPS_COP_0_CAUSE); +MIPS_RW32_COP0(compare, MIPS_COP_0_COMPARE); +MIPS_RW32_COP0(config, MIPS_COP_0_CONFIG); +MIPS_RW32_COP0_SEL(config1, MIPS_COP_0_CONFIG, 1); +MIPS_RW32_COP0_SEL(config2, MIPS_COP_0_CONFIG, 2); +MIPS_RW32_COP0_SEL(config3, MIPS_COP_0_CONFIG, 3); +MIPS_RW32_COP0(count, MIPS_COP_0_COUNT); +MIPS_RW32_COP0(index, MIPS_COP_0_TLB_INDEX); +MIPS_RW32_COP0(wired, MIPS_COP_0_TLB_WIRED); +MIPS_RW32_COP0(cause, MIPS_COP_0_CAUSE); #if !defined(__mips_n64) -MIPS_RDWR32_COP0(excpc, MIPS_COP_0_EXC_PC); +MIPS_RW32_COP0(excpc, MIPS_COP_0_EXC_PC); #endif -MIPS_RDRW32_COP0(status, MIPS_COP_0_STATUS); +MIPS_RW32_COP0(status, MIPS_COP_0_STATUS); /* XXX: Some of these registers are specific to MIPS32. */ #if !defined(__mips_n64) -MIPS_RDRW32_COP0(entrylo0, MIPS_COP_0_TLB_LO0); -MIPS_RDRW32_COP0(entrylo1, MIPS_COP_0_TLB_LO1); -MIPS_RDRW32_COP0(entryhi, MIPS_COP_0_TLB_HI); -MIPS_RDRW32_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); +MIPS_RW32_COP0(entrylo0, MIPS_COP_0_TLB_LO0); +MIPS_RW32_COP0(entrylo1, MIPS_COP_0_TLB_LO1); +MIPS_RW32_COP0(entryhi, MIPS_COP_0_TLB_HI); +MIPS_RW32_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); #endif -MIPS_RDRW32_COP0(prid, MIPS_COP_0_PRID); +MIPS_RW32_COP0(prid,
Re: svn commit: r216969 - head/sys/mips/conf
On Wed, Jan 5, 2011 at 10:54, Bjoern A. Zeeb wrote: > Thanks for fixing. > > Can anyone look at MALTA64 OCTEON1 SWARM64 SWARM64_SMP and XLR64 as > well? Those seem to be the last kernels failing on universe now. 64-bit kernels are broken in make universe because we don't simply ignore kernels with unknown TARGET_ARCH values; that's probably the right thing to do until someone checks in changes to eliminate TARGET_ABI and support TARGET_ARCH for non-o32 ABIs instead. Thanks, Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r217123 - in head: . gnu/lib/libgcc gnu/lib/libgomp gnu/usr.bin/binutils gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/libbfd gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/l
On Fri, Jan 7, 2011 at 12:26, Warner Losh wrote: > --- head/gnu/lib/libgcc/Makefile Fri Jan 7 20:07:30 2011 > (r217122) > +++ head/gnu/lib/libgcc/Makefile Fri Jan 7 20:26:33 2011 > (r217123) > @@ -119,9 +119,10 @@ LIB2FUNCS_EXTRA = floatunsidf.c floatuns > # _fixsfsi _fixunssfsi _floatdidf _floatdisf > .endif > > -.if ${TARGET_CPUARCH} == "mips" > +.if ${TARGET_CPUARCH} == mips > LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c > -.if defined(TARGET_ABI) && ${TARGET_ABI} != "o32" > +# XXX do we need n32 here? > +.if ${TARGET_ARCH:Mmips64*} != "" Almost certainly. n32 fails the != o32 check. I was careful when I made the TARGET_ABI changes. There's a possibility that this was wrong for some reason, but I'm skeptical. == > --- head/lib/libc/Makefile Fri Jan 7 20:07:30 2011 (r217122) > +++ head/lib/libc/Makefile Fri Jan 7 20:26:33 2011 (r217123) > @@ -68,11 +68,7 @@ NOASM= > ${LIBC_ARCH} != "ia64" && \ > ${LIBC_ARCH} != "powerpc64" && \ > ${LIBC_ARCH} != "sparc64" && \ > - ${LIBC_ARCH} != "mips" > -.include "${.CURDIR}/quad/Makefile.inc" > -.endif > -.if ${LIBC_ARCH} == "mips" && \ > - (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32") > + ${MACHINE_ARCH:Mmips64*} == "" > .include "${.CURDIR}/quad/Makefile.inc" Here it's definitely wrong to restate !=o32 as ==n64; n32 doesn't need soft quads, it has 64-bit registers. Thanks, Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r217147 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include
On Sat, Jan 8, 2011 at 04:43, Tijl Coosemans wrote: > Author: tijl > Date: Sat Jan 8 12:43:05 2011 > New Revision: 217147 > URL: http://svn.freebsd.org/changeset/base/217147 > > Log: > On mixed 32/64 bit architectures (mips, powerpc) use __LP64__ rather than > architecture macros (__mips_n64, __powerpc64__) when 64 bit types (and > corresponding macros) are different from 32 bit. [1] I don't know why you didn't talk with MIPS people at all about these changes. That they were reviewed by Bruce is very reassuring in aesthetic terms, but that's hardly sufficient. This and other changes have made it harder to support common MIPS configurations and compilation options on FreeBSD. I'm glad you're at least aware of n32 (as indicated in another message) and its implications, but the use of ABI-specific names was deliberate. Have you thought about -n32 with -mlong64? It isn't the same kind of dirty hack as Bruce talks about when he talks about 64-bit longs on x86. I understand that __LP64__ and the idea that there are two reasonable ABIs most (one 32-bit and one 64-bit) is appealing, but it's not true. In the case of PowerPC, it does look like they weren't ABI-specific macros, but MIPS's were. If nothing else, you make MIPS headers more inconsistent with themselves, where most of them are ABI-conditionalized and now some are instead LP64-centric. It seems like your end goal is probably consolidating these headers, which I would like, too, but please attempt to allow for more variation than just "longs are 32-bit and pointers are 32-bit, otherwise longs are 64-bit and pointers are 64-bit." We're trying to do the right thing with MIPS in terms of supporting multiple valid ABIs on a single port, something which is a lot harder when people restructure these critical headers without even asking us whether there are any evident problems; even if 'make universe', for instance, were enough, it leaves out some ABIs, and it certainly leaves out future plans wrt ABIs. Thanks, Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217210 - head/sys/mips/cavium/octe
Author: jmallett Date: Sun Jan 9 23:05:46 2011 New Revision: 217210 URL: http://svn.freebsd.org/changeset/base/217210 Log: 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. Modified: head/sys/mips/cavium/octe/ethernet-defines.h head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/ethernet-defines.h == --- head/sys/mips/cavium/octe/ethernet-defines.hSun Jan 9 22:47:58 2011(r217209) +++ head/sys/mips/cavium/octe/ethernet-defines.hSun Jan 9 23:05:46 2011(r217210) @@ -79,8 +79,6 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS #define USE_MULTICORE_RECEIVE 0 #endif -#define IP_PROTOCOL_TCP 6 -#define IP_PROTOCOL_UDP 0x11 #define FAU_NUM_PACKET_BUFFERS_TO_FREE (CVMX_FAU_REG_END - sizeof(uint32_t)) #define TOTAL_NUMBER_OF_PORTS (CVMX_PIP_NUM_INPUT_PORTS+1) Modified: head/sys/mips/cavium/octe/ethernet.c == --- head/sys/mips/cavium/octe/ethernet.cSun Jan 9 22:47:58 2011 (r217209) +++ head/sys/mips/cavium/octe/ethernet.cSun Jan 9 23:05:46 2011 (r217210) @@ -235,15 +235,16 @@ static void cvm_oct_configure_common_hw( if (USE_MULTICORE_RECEIVE) { critical_enter(); { - int cpu; - for (cpu = 0; cpu < mp_maxid; cpu++) { - if (!CPU_ABSENT(cpu) && - (cpu != PCPU_GET(cpuid))) { - cvmx_ciu_intx0_t en; - en.u64 = cvmx_read_csr(CVMX_CIU_INTX_EN0(cpu*2)); - en.s.workq |= (1
svn commit: r217212 - head/sys/mips/cavium/octe
Author: jmallett Date: Sun Jan 9 23:46:24 2011 New Revision: 217212 URL: http://svn.freebsd.org/changeset/base/217212 Log: 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. Modified: head/sys/mips/cavium/octe/ethernet-rx.c Modified: head/sys/mips/cavium/octe/ethernet-rx.c == --- head/sys/mips/cavium/octe/ethernet-rx.c Sun Jan 9 23:20:01 2011 (r217211) +++ head/sys/mips/cavium/octe/ethernet-rx.c Sun Jan 9 23:46:24 2011 (r217212) @@ -54,6 +54,8 @@ extern struct ifnet *cvm_oct_device[]; static struct task cvm_oct_task; static struct taskqueue *cvm_oct_taskq; +static int cvm_oct_rx_active; + /** * Interrupt handler. The interrupt occurs whenever the POW * transitions from 0->1 packets in our group. @@ -70,7 +72,13 @@ int cvm_oct_do_interrupt(void *dev_id) cvmx_write_csr(CVMX_POW_WQ_INT, 1
svn commit: r217214 - in head/sys: contrib/octeon-sdk mips/cavium mips/conf
== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/if_octm.c Mon Jan 10 03:48:41 2011 (r217214) @@ -0,0 +1,519 @@ +/*- + * Copyright (c) 2010-2011 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Cavium Octeon management port Ethernet devices. + */ + +#include "opt_inet.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef INET +#include +#include +#endif + +#include +#include +#include + +struct octm_softc { + struct ifnet *sc_ifp; + device_t sc_dev; + unsigned sc_port; + int sc_flags; + struct ifmedia sc_ifmedia; + struct resource *sc_intr; + void *sc_intr_cookie; +}; + +static voidoctm_identify(driver_t *, device_t); +static int octm_probe(device_t); +static int octm_attach(device_t); +static int octm_detach(device_t); +static int octm_shutdown(device_t); + +static voidoctm_init(void *); +static int octm_transmit(struct ifnet *, struct mbuf *); + +static int octm_medchange(struct ifnet *); +static voidoctm_medstat(struct ifnet *, struct ifmediareq *); + +static int octm_ioctl(struct ifnet *, u_long, caddr_t); + +static voidoctm_rx_intr(void *); + +static device_method_t octm_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, octm_identify), + DEVMETHOD(device_probe, octm_probe), + DEVMETHOD(device_attach,octm_attach), + DEVMETHOD(device_detach,octm_detach), + DEVMETHOD(device_shutdown, octm_shutdown), + + { 0, 0 } +}; + +static driver_t octm_driver = { + "octm", + octm_methods, + sizeof (struct octm_softc), +}; + +static devclass_t octm_devclass; + +DRIVER_MODULE(octm, ciu, octm_driver, octm_devclass, 0, 0); + +static void +octm_identify(driver_t *drv, device_t parent) +{ + unsigned i; + + if (!octeon_has_feature(OCTEON_FEATURE_MGMT_PORT)) + return; + + for (i = 0; i < CVMX_MGMT_PORT_NUM_PORTS; i++) + BUS_ADD_CHILD(parent, 0, "octm", i); +} + +static int +octm_probe(device_t dev) +{ + cvmx_mgmt_port_result_t result; + + result = cvmx_mgmt_port_initialize(device_get_unit(dev)); + switch (result) { + case CVMX_MGMT_PORT_SUCCESS: + break; + case CVMX_MGMT_PORT_NO_MEMORY: + return (ENOBUFS); + case CVMX_MGMT_PORT_INVALID_PARAM: + return (ENXIO); + case CVMX_MGMT_PORT_INIT_ERROR: + return (EIO); + } + + device_set_desc(dev, "Cavium Octeon Management Ethernet"); + + return (0); +} + +static int +octm_attach(device_t dev) +{ + struct ifnet *ifp; + struct octm_softc *sc; + cvmx_mixx_irhwm_t mixx_irhwm; + cvmx_mixx_intena_t mixx_intena; + uint64_t mac; + int error; + int irq; + int rid; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_port = device_get_unit(dev); + + switch (sc->sc_port) { + case 0: + irq = CVMX_IRQ_MII; + break; + case 1: + irq = CVMX_IRQ_MII1; + break; + default: + device_printf(dev, "unsupported management port %u.\n", sc->sc_port); + return (ENXIO); + } + + mac = cvmx_mgmt_port_get_mac(sc->sc_port); + if (ma
svn commit: r217222 - head/sys/mips/cavium
Author: jmallett Date: Mon Jan 10 06:46:18 2011 New Revision: 217222 URL: http://svn.freebsd.org/changeset/base/217222 Log: 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. Modified: head/sys/mips/cavium/if_octm.c Modified: head/sys/mips/cavium/if_octm.c == --- head/sys/mips/cavium/if_octm.c Mon Jan 10 06:12:01 2011 (r217221) +++ head/sys/mips/cavium/if_octm.c Mon Jan 10 06:46:18 2011 (r217222) @@ -511,9 +511,15 @@ octm_rx_intr(void *arg) continue; } + m_freem(m); + if (len == 0) break; sc->sc_ifp->if_ierrors++; } + + /* Acknowledge interrupts. */ + cvmx_write_csr(CVMX_MIXX_ISR(sc->sc_port), mixx_isr.u64); + cvmx_read_csr(CVMX_MIXX_ISR(sc->sc_port)); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217243 - head/sys/mips/cavium
Author: jmallett Date: Mon Jan 10 22:14:08 2011 New Revision: 217243 URL: http://svn.freebsd.org/changeset/base/217243 Log: Shorten device name so it fits into vmstat -i. Modified: head/sys/mips/cavium/octeon_wdog.c Modified: head/sys/mips/cavium/octeon_wdog.c == --- head/sys/mips/cavium/octeon_wdog.c Mon Jan 10 21:35:10 2011 (r217242) +++ head/sys/mips/cavium/octeon_wdog.c Mon Jan 10 22:14:08 2011 (r217243) @@ -254,7 +254,7 @@ static void octeon_wdog_identify(driver_t *drv, device_t parent) { - BUS_ADD_CHILD(parent, 0, "octeon_wdog", 0); + BUS_ADD_CHILD(parent, 0, "owdog", 0); } static device_method_t octeon_wdog_methods[] = { @@ -266,10 +266,10 @@ static device_method_t octeon_wdog_metho }; static driver_t octeon_wdog_driver = { - "octeon_wdog", + "owdog", octeon_wdog_methods, sizeof(struct octeon_wdog_softc), }; static devclass_t octeon_wdog_devclass; -DRIVER_MODULE(octeon_wdog, ciu, octeon_wdog_driver, octeon_wdog_devclass, 0, 0); +DRIVER_MODULE(owdog, ciu, octeon_wdog_driver, octeon_wdog_devclass, 0, 0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217244 - in head/sys/mips/cavium: . octe
Author: jmallett Date: Mon Jan 10 22:14:30 2011 New Revision: 217244 URL: http://svn.freebsd.org/changeset/base/217244 Log: Count output bytes and packets. Modified: head/sys/mips/cavium/if_octm.c head/sys/mips/cavium/octe/ethernet-tx.c Modified: head/sys/mips/cavium/if_octm.c == --- head/sys/mips/cavium/if_octm.c Mon Jan 10 22:14:08 2011 (r217243) +++ head/sys/mips/cavium/if_octm.c Mon Jan 10 22:14:30 2011 (r217244) @@ -333,9 +333,12 @@ octm_transmit(struct ifnet *ifp, struct result = cvmx_mgmt_port_sendm(sc->sc_port, m); - if (result == CVMX_MGMT_PORT_SUCCESS) + if (result == CVMX_MGMT_PORT_SUCCESS) { ETHER_BPF_MTAP(ifp, m); - else + + ifp->if_opackets++; + ifp->if_obytes += m->m_pkthdr.len; + } else ifp->if_oerrors++; m_freem(m); Modified: head/sys/mips/cavium/octe/ethernet-tx.c == --- head/sys/mips/cavium/octe/ethernet-tx.c Mon Jan 10 22:14:08 2011 (r217243) +++ head/sys/mips/cavium/octe/ethernet-tx.c Mon Jan 10 22:14:30 2011 (r217244) @@ -247,6 +247,9 @@ int cvm_oct_xmit(struct mbuf *m, struct /* Pass it to any BPF listeners. */ ETHER_BPF_MTAP(ifp, m); + + ifp->if_opackets++; + ifp->if_obytes += m->m_pkthdr.len; } /* Free mbufs not in use by the hardware */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217254 - head/sys/mips/cavium
Author: jmallett Date: Tue Jan 11 02:37:58 2011 New Revision: 217254 URL: http://svn.freebsd.org/changeset/base/217254 Log: Initialize PCIe buses and add preliminary support for 64-bit BARs. Modified: head/sys/mips/cavium/octopci.c Modified: head/sys/mips/cavium/octopci.c == --- head/sys/mips/cavium/octopci.c Tue Jan 11 01:57:02 2011 (r217253) +++ head/sys/mips/cavium/octopci.c Tue Jan 11 02:37:58 2011 (r217254) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Juli Mallett + * Copyright (c) 2010-2011 Juli Mallett * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -70,9 +71,11 @@ struct octopci_softc { unsigned sc_domain; unsigned sc_bus; + bus_addr_t sc_io_base; unsigned sc_io_next; struct rman sc_io; + bus_addr_t sc_mem1_base; unsigned sc_mem1_next; struct rman sc_mem1; }; @@ -92,25 +95,33 @@ static void octopci_write_config(device_ uint32_t, int); static int octopci_route_interrupt(device_t, device_t, int); -static voidoctopci_init_bar(device_t, unsigned, unsigned, unsigned, unsigned, uint8_t *); +static unsignedoctopci_init_bar(device_t, unsigned, unsigned, unsigned, unsigned, uint8_t *); static unsignedoctopci_init_device(device_t, unsigned, unsigned, unsigned, unsigned); static unsignedoctopci_init_bus(device_t, unsigned); +static voidoctopci_init_pci(device_t); static uint64_toctopci_cs_addr(unsigned, unsigned, unsigned, unsigned); static void octopci_identify(driver_t *drv, device_t parent) { + /* XXX Check sysinfo flag. */ + BUS_ADD_CHILD(parent, 0, "pcib", 0); + if (octeon_has_feature(OCTEON_FEATURE_PCIE)) + BUS_ADD_CHILD(parent, 0, "pcib", 1); } static int octopci_probe(device_t dev) { + if (octeon_has_feature(OCTEON_FEATURE_PCIE)) { + device_set_desc(dev, "Cavium Octeon PCIe bridge"); + return (0); + } + if (device_get_unit(dev) != 0) return (ENXIO); - if (octeon_has_feature(OCTEON_FEATURE_PCIE)) - return (ENXIO); - /* XXX Check sysinfo flag. */ + device_set_desc(dev, "Cavium Octeon PCI bridge"); return (0); } @@ -119,214 +130,47 @@ static int octopci_attach(device_t dev) { struct octopci_softc *sc; - cvmx_npi_mem_access_subid_t npi_mem_access_subid; - cvmx_npi_pci_int_arb_cfg_t npi_pci_int_arb_cfg; - cvmx_npi_ctl_status_t npi_ctl_status; - cvmx_pci_ctl_status_2_t pci_ctl_status_2; - cvmx_pci_cfg56_t pci_cfg56; - cvmx_pci_cfg22_t pci_cfg22; - cvmx_pci_cfg16_t pci_cfg16; - cvmx_pci_cfg19_t pci_cfg19; - cvmx_pci_cfg01_t pci_cfg01; unsigned subbus; - unsigned i; int error; - /* -* Reset the PCI bus. -*/ - cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x1); - cvmx_read_csr(CVMX_CIU_SOFT_PRST); - - DELAY(2000); - - npi_ctl_status.u64 = 0; - npi_ctl_status.s.max_word = 1; - npi_ctl_status.s.timer = 1; - cvmx_write_csr(CVMX_NPI_CTL_STATUS, npi_ctl_status.u64); - - /* -* Set host mode. -*/ - switch (cvmx_sysinfo_get()->board_type) { -#if defined(OCTEON_VENDOR_LANNER) - case CVMX_BOARD_TYPE_CUST_LANNER_MR320: - case CVMX_BOARD_TYPE_CUST_LANNER_MR955: - /* 32-bit PCI-X */ - cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x0); - break; -#endif - default: - /* 64-bit PCI-X */ - cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x4); - break; - } - cvmx_read_csr(CVMX_CIU_SOFT_PRST); - - DELAY(2000); - - /* -* Enable BARs and configure big BAR mode. -*/ - pci_ctl_status_2.u32 = 0; - pci_ctl_status_2.s.bb1_hole = 5; /* 256MB hole in BAR1 */ - pci_ctl_status_2.s.bb1_siz = 1; /* BAR1 is 2GB */ - pci_ctl_status_2.s.bb_ca = 1; /* Bypass cache for big BAR */ - pci_ctl_status_2.s.bb_es = 1; /* Do big BAR byte-swapping */ - pci_ctl_status_2.s.bb1 = 1; /* BAR1 is big */ - pci_ctl_status_2.s.bb0 = 1; /* BAR0 is big */ - pci_ctl_status_2.s.bar2pres = 1; /* BAR2 present */ - pci_ctl_status_2.s.pmo_amod = 1; /* Round-robin priority */ - pci_ctl_status_2.s.tsr_hwm = 1; - pci_ctl_status_2.s.bar2_enb = 1; /* Enable BAR2 */ - pci_ctl_status_2.s.bar2_esx = 1; /* Do BAR2 byte-swapping */ - pci_ctl_status_2.s.bar2_cax = 1; /* Bypass cache for BAR2 */ + sc = device_get_softc(dev); + sc->sc_dev = dev; - NPI_WRITE(CVMX_NPI_PCI_CTL_STATUS_
svn commit: r217573 - head/sys/mips/cavium
Author: jmallett Date: Wed Jan 19 07:06:28 2011 New Revision: 217573 URL: http://svn.freebsd.org/changeset/base/217573 Log: Don't do a device_identify to add uart0, it's already hinted. Reported by: imp Modified: head/sys/mips/cavium/uart_bus_octeonusart.c Modified: head/sys/mips/cavium/uart_bus_octeonusart.c == --- head/sys/mips/cavium/uart_bus_octeonusart.c Wed Jan 19 05:13:40 2011 (r217572) +++ head/sys/mips/cavium/uart_bus_octeonusart.c Wed Jan 19 07:06:28 2011 (r217573) @@ -63,7 +63,6 @@ extern struct uart_class uart_oct16550_c static int uart_octeon_probe(device_t dev); -static void octeon_uart_identify(driver_t * drv, device_t parent); extern struct uart_class octeon_uart_class; @@ -72,7 +71,6 @@ static device_method_t uart_octeon_metho DEVMETHOD(device_probe, uart_octeon_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), - DEVMETHOD(device_identify, octeon_uart_identify), {0, 0} }; @@ -113,10 +111,4 @@ uart_octeon_probe(device_t dev) return (uart_bus_probe(dev, sc->sc_bas.regshft, 0, 0, unit)); } -static void -octeon_uart_identify(driver_t * drv, device_t parent) -{ - BUS_ADD_CHILD(parent, 0, "uart", 0); -} - DRIVER_MODULE(uart, obio, uart_octeon_driver, uart_devclass, 0, 0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217607 - head/sys/mips/rmi
Author: jmallett Date: Wed Jan 19 21:45:40 2011 New Revision: 217607 URL: http://svn.freebsd.org/changeset/base/217607 Log: Fix format of physical addresses; this fixes the n32 build. Modified: head/sys/mips/rmi/xlr_machdep.c Modified: head/sys/mips/rmi/xlr_machdep.c == --- head/sys/mips/rmi/xlr_machdep.c Wed Jan 19 21:43:08 2011 (r217606) +++ head/sys/mips/rmi/xlr_machdep.c Wed Jan 19 21:45:40 2011 (r217607) @@ -358,9 +358,9 @@ xlr_mem_init(void) } phys_avail[1] = boot_map->physmem_map[0].addr + boot_map->physmem_map[0].size; - printf("First segment: addr:%p -> %p \n", - (void *)phys_avail[0], - (void *)phys_avail[1]); + printf("First segment: addr:%#jx -> %#jx \n", + (uintmax_t)phys_avail[0], + (uintmax_t)phys_avail[1]); dump_avail[0] = phys_avail[0]; dump_avail[1] = phys_avail[1]; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217612 - head/sys/conf
Author: jmallett Date: Wed Jan 19 22:15:12 2011 New Revision: 217612 URL: http://svn.freebsd.org/changeset/base/217612 Log: The output format should be determined by the ABI flags, not the ldscript. This ldscript is used with both little-endian and big-endian targets. This hopefully fixes MIPS universe. NB: We really should get rid of almost all of the MIPS ldscripts. There's only gratuitous differences between them, mostly because they're too specific or they do things like specify the output format rather than taking it from flags given in the kernel config file or the default output format of the compiler. Also add svn:keywords property. Modified: head/sys/conf/ldscript.mips.mips64 (contents, props changed) Modified: head/sys/conf/ldscript.mips.mips64 == --- head/sys/conf/ldscript.mips.mips64 Wed Jan 19 22:10:35 2011 (r217611) +++ head/sys/conf/ldscript.mips.mips64 Wed Jan 19 22:15:12 2011 (r217612) @@ -27,12 +27,9 @@ * SUCH DAMAGE. * * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 - * $FreeBSD: projects/mips/sys/conf/ldscript.mips 191079 2009-04-14 22:53:22Z gonzo $ + * $FreeBSD$ */ -OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", - "elf64-tradlittlemips") - OUTPUT_ARCH(mips) ENTRY(_start) SEARCH_DIR(/usr/lib); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217664 - head/sys/mips/cavium/octe
Author: jmallett Date: Thu Jan 20 23:34:59 2011 New Revision: 217664 URL: http://svn.freebsd.org/changeset/base/217664 Log: 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. Modified: head/sys/mips/cavium/octe/ethernet-defines.h head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/ethernet-defines.h == --- head/sys/mips/cavium/octe/ethernet-defines.hThu Jan 20 22:58:10 2011(r217663) +++ head/sys/mips/cavium/octe/ethernet-defines.hThu Jan 20 23:34:59 2011(r217664) @@ -30,43 +30,15 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS /* * A few defines are used to control the operation of this driver: - * CONFIG_CAVIUM_RESERVE32 - * This kernel config options controls the amount of memory configured - * in a wired TLB entry for all processes to share. If this is set, the - * driver will use this memory instead of kernel memory for pools. This - * allows 32bit userspace application to access the buffers, but also - * requires all received packets to be copied. * CONFIG_CAVIUM_OCTEON_NUM_PACKET_BUFFERS * This kernel config option allows the user to control the number of * packet and work queue buffers allocated by the driver. If this is zero, * the driver uses the default from below. - * USE_HW_TCPUDP_CHECKSUM - * Controls if the Octeon TCP/UDP checksum engine is used for packet - * output. If this is zero, the kernel will perform the checksum in - * software. - * USE_MULTICORE_RECEIVE - * Process receive interrupts on multiple cores. This spreads the network - * load across the first 8 processors. If ths is zero, only one core - * processes incomming packets. - * USE_ASYNC_IOBDMA - * Use asynchronous IO access to hardware. This uses Octeon's asynchronous - * IOBDMAs to issue IO accesses without stalling. Set this to zero - * to disable this. Note that IOBDMAs require CVMSEG. */ -#ifndef CONFIG_CAVIUM_RESERVE32 -#define CONFIG_CAVIUM_RESERVE32 0 -#endif #define INTERRUPT_LIMIT 1 /* Max interrupts per second per core */ /*#define INTERRUPT_LIMIT 0 *//* Don't limit the number of interrupts */ -#define USE_HW_TCPUDP_CHECKSUM 1 -#define USE_MULTICORE_RECEIVE 1 #define USE_RED 1 /* Enable Random Early Dropping under load */ -#if 0 -#define USE_ASYNC_IOBDMA(CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0) -#else -#define USE_ASYNC_IOBDMA0 -#endif #define USE_10MBPS_PREAMBLE_WORKAROUND 1/* Allow SW based preamble removal at 10Mbps to workaround PHYs giving us bad preambles */ #define DONT_WRITEBACK(x) (x) /* Use this to have all FPA frees also tell the L2 not to write data to memory */ /*#define DONT_WRITEBACK(x) 0 *//* Use this to not have FPA frees control L2 */ @@ -74,11 +46,6 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS #define MAX_RX_PACKETS 120 /* Maximum number of packets to process per interrupt. */ #define MAX_OUT_QUEUE_DEPTH 1000 -#ifndef SMP -#undef USE_MULTICORE_RECEIVE -#define USE_MULTICORE_RECEIVE 0 -#endif - #define FAU_NUM_PACKET_BUFFERS_TO_FREE (CVMX_FAU_REG_END - sizeof(uint32_t)) #define TOTAL_NUMBER_OF_PORTS (CVMX_PIP_NUM_INPUT_PORTS+1) Modified: head/sys/mips/cavium/octe/ethernet-rx.c == --- head/sys/mips/cavium/octe/ethernet-rx.c Thu Jan 20 22:58:10 2011 (r217663) +++ head/sys/mips/cavium/octe/ethernet-rx.c Thu Jan 20 23:34:59 2011 (r217664) @@ -164,7 +164,6 @@ void cvm_oct_tasklet_rx(void *context, i { int coreid; uint64_told_group_mask; - uint64_told_scratch; int rx_count = 0; int number_to_free; int num_freed; @@ -176,49 +175,24 @@ void cvm_oct_tasklet_rx(void *context, i /* Prefetch cvm_oct_device since we know we need it soon */ CVMX_PREFETCH(cvm_oct_device, 0); - if (USE_ASYNC_IOBDMA) { - /* Save scratch in case userspace is using it */ - CVMX_SYNCIOBDMA; - old_scratch = cvmx_scratch_read64(CVMX_SCR_SCRATCH); - } - /* Only allow work for our group (and preserve priorities) */ old_group_mask = cvmx_read_csr(CVMX_POW_PP_GRP_MSKX(coreid)); cvmx_write_csr(CVMX_POW_PP_GRP_MSKX(coreid), (old_group_mask & ~0xull) | 1
svn commit: r217665 - head/sys/mips/cavium/octe
Author: jmallett Date: Thu Jan 20 23:51:03 2011 New Revision: 217665 URL: http://svn.freebsd.org/changeset/base/217665 Log: If there is no WQE available for a packet that needs segmentation, drop it and return. Modified: head/sys/mips/cavium/octe/ethernet-tx.c Modified: head/sys/mips/cavium/octe/ethernet-tx.c == --- head/sys/mips/cavium/octe/ethernet-tx.c Thu Jan 20 23:34:59 2011 (r217664) +++ head/sys/mips/cavium/octe/ethernet-tx.c Thu Jan 20 23:51:03 2011 (r217665) @@ -142,9 +142,14 @@ int cvm_oct_xmit(struct mbuf *m, struct * in memory we borrow from the WQE pool. */ work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); - gp = (uint64_t *)work; + if (work == NULL) { + m_freem(m); + ifp->if_oerrors++; + return 1; + } segs = 0; + gp = (uint64_t *)work; for (n = m; n != NULL; n = n->m_next) { if (segs == CVMX_FPA_WQE_POOL_SIZE / sizeof (uint64_t)) panic("%s: too many segments in packet; call m_collapse().", __func__); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r218195 - in head/sys: amd64/amd64 arm/arm i386/i386 ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc64 sun4v/sun4v sys ufs/ffs
On Wed, Feb 2, 2011 at 08:35, Matthew D Fleming wrote: > Author: mdf > Date: Wed Feb 2 16:35:10 2011 > New Revision: 218195 > URL: http://svn.freebsd.org/changeset/base/218195 > > Log: > Put the general logic for being a CPU hog into a new function > should_yield(). Use this in various places. Encapsulate the common > case of check-and-yield into a new function maybe_yield(). > > Change several checks for a magic number of iterations to use > should_yield() instead. First off, I admittedly don't know or care very much about this area, but this commit stood out to me and I had a few minor concerns. I'm slightly uncomfortable with the flat namespace here. It isn't obvious from the names that maybe_yield() and should_yield() relate only to uio_yield() and not other types of yielding (from DELAY() to cpu_idle() to sched_yield().) The other problematic element here is that "maybe_yield" and "should_yield" could quite reasonably be variables or functions in existing code in the kernel, and although we don't try to protect against changes that could cause such collisions, we shouldn't do them gratuitously, and there's even something that seems aesthetically off about these; they seem...informal, even Linuxy. I think names like uio_should_yield() and uio_maybe_yield() wouldn't have nearly as much of a problem, since the context of the question of "should" is isolated to uio operations rather than, say, whether the scheduler would *like* for us, as the running thread, to yield, or other considerations that may be more general. Thanks, Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r218232 - head/sys/netinet
On Thu, Feb 3, 2011 at 12:29, John Baldwin wrote: >> ip = mtod(m, struct ip *); >> offset = off + sizeof(*sh); >> if (SCTP_BUF_LEN(m) < offset) { >> @@ -5944,7 +5947,7 @@ sctp_input(struct mbuf *m, int off) >> ip = mtod(m, struct ip *); >> } >> sh = (struct sctphdr *)((caddr_t)ip + off); >> - cpu_to_use = ntohl(sh->v_tag) % mp_ncpus; >> + cpu_to_use = ntohl(sh->v_tag) % mp_maxid; > > Hmmm, this is more complicated. Can sctp_queue_to_mcore() handle the fact > that a cpu_to_use value might not be valid? If not you might want to maintain > a separate "dense" virtual CPU ID table numbered 0 .. mp_ncpus - 1 that maps > to "present" FreeBSD CPU IDs. I think Robert has done something similar to > support RSS in TCP. Does that make sense? Plus mp_maxid is inclusive, so rrs probably meant (mp_maxid + 1) not mp_maxid in that modulus. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r218383 - head/sys/mips/include
Author: jmallett Date: Sun Feb 6 22:21:18 2011 New Revision: 218383 URL: http://svn.freebsd.org/changeset/base/218383 Log: o) Cavium Octeon doesn't need nop barriers. o) Have mips_wblush just do syncw, not sync on Cavium Octeon. o) Add support for reading and writing some Octeon-specific registers. NB: Some of these are not entirely Octeon-specific. Submitted by: Bhanu Prakash Modified: head/sys/mips/include/cpufunc.h Modified: head/sys/mips/include/cpufunc.h == --- head/sys/mips/include/cpufunc.h Sun Feb 6 22:18:37 2011 (r218382) +++ head/sys/mips/include/cpufunc.h Sun Feb 6 22:21:18 2011 (r218383) @@ -69,6 +69,9 @@ static __inline void mips_barrier(void) { +#ifdef CPU_CNMIPS + __asm __volatile("" : : : "memory"); +#else __asm __volatile (".set noreorder\n\t" "nop\n\t" "nop\n\t" @@ -80,6 +83,7 @@ mips_barrier(void) "nop\n\t" ".set reorder\n\t" : : : "memory"); +#endif } static __inline void @@ -91,8 +95,15 @@ mips_cp0_sync(void) static __inline void mips_wbflush(void) { +#if defined(CPU_CNMIPS) + __asm __volatile (".set noreorder\n\t" + "syncw\n\t" + ".set reorder\n" + : : : "memory"); +#else __asm __volatile ("sync" : : : "memory"); mips_barrier(); +#endif } static __inline void @@ -136,10 +147,37 @@ mips_wr_ ## n (uint64_t a0) \ mips_barrier(); \ } struct __hack +#defineMIPS_RW64_COP0_SEL(n,r,s) \ +static __inline uint64_t \ +mips_rd_ ## n(void)\ +{ \ + int v0; \ + __asm __volatile ("dmfc0 %[v0], $"__XSTRING(r)", "__XSTRING(s)";" \ + : [v0] "=&r"(v0));\ + mips_barrier(); \ + return (v0);\ +} \ +static __inline void \ +mips_wr_ ## n(uint64_t a0) \ +{ \ + __asm __volatile ("dmtc0 %[a0], $"__XSTRING(r)", "__XSTRING(s)";" \ +__XSTRING(COP0_SYNC)";"\ +: \ +: [a0] "r"(a0)); \ + mips_barrier(); \ +} struct __hack + #if defined(__mips_n64) MIPS_RW64_COP0(excpc, MIPS_COP_0_EXC_PC); MIPS_RW64_COP0(entryhi, MIPS_COP_0_TLB_HI); MIPS_RW64_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); +#ifdef CPU_CNMIPS +MIPS_RW64_COP0_SEL(cvmcount, MIPS_COP_0_COUNT, 6); +MIPS_RW64_COP0_SEL(cvmctl, MIPS_COP_0_COUNT, 7); +MIPS_RW64_COP0_SEL(cvmmemctl, MIPS_COP_0_COMPARE, 7); +MIPS_RW64_COP0_SEL(icache_err, MIPS_COP_0_CACHE_ERR, 0); +MIPS_RW64_COP0_SEL(dcache_err, MIPS_COP_0_CACHE_ERR, 1); +#endif #endif #if defined(__mips_n64) || defined(__mips_n32) /* PHYSADDR_64_BIT */ MIPS_RW64_COP0(entrylo0, MIPS_COP_0_TLB_LO0); @@ -148,6 +186,7 @@ MIPS_RW64_COP0(entrylo1, MIPS_COP_0_TLB_ MIPS_RW64_COP0(xcontext, MIPS_COP_0_TLB_XCONTEXT); #undef MIPS_RW64_COP0 +#undef MIPS_RW64_COP0_SEL #endif #defineMIPS_RW32_COP0(n,r) \ @@ -212,6 +251,9 @@ MIPS_RW32_COP0(config, MIPS_COP_0_CONFIG MIPS_RW32_COP0_SEL(config1, MIPS_COP_0_CONFIG, 1); MIPS_RW32_COP0_SEL(config2, MIPS_COP_0_CONFIG, 2); MIPS_RW32_COP0_SEL(config3, MIPS_COP_0_CONFIG, 3); +#ifdef CPU_CNMIPS +MIPS_RW32_COP0_SEL(config4, MIPS_COP_0_CONFIG, 4); +#endif MIPS_RW32_COP0(count, MIPS_COP_0_COUNT); MIPS_RW32_COP0(index, MIPS_COP_0_TLB_INDEX); MIPS_RW32_COP0(wired, MIPS_COP_0_TLB_WIRED); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r218584 - head/sys/kern
Author: jmallett Date: Fri Feb 11 22:43:10 2011 New Revision: 218584 URL: http://svn.freebsd.org/changeset/base/218584 Log: With smp_topo_none, set cg_mask to all_cpus rather than setting the mp_ncpus low bits. Submitted by: Bhanu Prakash Reviewed by: jeffr Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c == --- head/sys/kern/subr_smp.cFri Feb 11 19:49:07 2011(r218583) +++ head/sys/kern/subr_smp.cFri Feb 11 22:43:10 2011(r218584) @@ -476,7 +476,7 @@ smp_topo_none(void) top = &group[0]; top->cg_parent = NULL; top->cg_child = NULL; - top->cg_mask = ~0U >> (32 - mp_ncpus); + top->cg_mask = all_cpus; top->cg_count = mp_ncpus; top->cg_children = 0; top->cg_level = CG_SHARE_NONE; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r218591 - in head/sys/mips: cavium include mips rmi sibyte
Author: jmallett Date: Sat Feb 12 02:08:24 2011 New Revision: 218591 URL: http://svn.freebsd.org/changeset/base/218591 Log: 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 Modified: head/sys/mips/cavium/octeon_mp.c head/sys/mips/include/hwfunc.h head/sys/mips/mips/mp_machdep.c head/sys/mips/rmi/xlr_machdep.c head/sys/mips/sibyte/sb_scd.c Modified: head/sys/mips/cavium/octeon_mp.c == --- head/sys/mips/cavium/octeon_mp.cSat Feb 12 01:03:15 2011 (r218590) +++ head/sys/mips/cavium/octeon_mp.cSat Feb 12 02:08:24 2011 (r218591) @@ -102,10 +102,10 @@ platform_init_ap(int cpuid) mips_wbflush(); } -int -platform_num_processors(void) +cpumask_t +platform_cpu_mask(void) { - return (bitcount32(octeon_bootinfo->core_mask)); + return (octeon_bootinfo->core_mask); } struct cpu_group * Modified: head/sys/mips/include/hwfunc.h == --- head/sys/mips/include/hwfunc.h Sat Feb 12 01:03:15 2011 (r218590) +++ head/sys/mips/include/hwfunc.h Sat Feb 12 02:08:24 2011 (r218591) @@ -89,9 +89,9 @@ void platform_ipi_clear(void); extern int platform_processor_id(void); /* - * Return the number of processors available on this platform. + * Return the cpumask of available processors. */ -extern int platform_num_processors(void); +extern cpumask_t platform_cpu_mask(void); /* * Return the topology of processors on this platform Modified: head/sys/mips/mips/mp_machdep.c == --- head/sys/mips/mips/mp_machdep.c Sat Feb 12 01:03:15 2011 (r218590) +++ head/sys/mips/mips/mp_machdep.c Sat Feb 12 02:08:24 2011 (r218591) @@ -200,12 +200,14 @@ start_ap(int cpuid) void cpu_mp_setmaxid(void) { + cpumask_t cpumask; - mp_ncpus = platform_num_processors(); + cpumask = platform_cpu_mask(); + mp_ncpus = bitcount32(cpumask); if (mp_ncpus <= 0) mp_ncpus = 1; - mp_maxid = min(mp_ncpus, MAXCPU) - 1; + mp_maxid = min(fls(cpumask), MAXCPU) - 1; } void @@ -231,24 +233,30 @@ void cpu_mp_start(void) { int error, cpuid; + cpumask_t cpumask; mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); - all_cpus = 1; /* BSP */ - for (cpuid = 1; cpuid < platform_num_processors(); ++cpuid) { + all_cpus = 0; + cpumask = platform_cpu_mask(); + + while (cpumask != 0) { + cpuid = ffs(cpumask) - 1; + cpumask &= ~(1 << cpuid); + if (cpuid >= MAXCPU) { printf("cpu_mp_start: ignoring AP #%d.\n", cpuid); continue; } - if ((error = start_ap(cpuid)) != 0) { - printf("AP #%d failed to start: %d\n", cpuid, error); - continue; + if (cpuid != platform_processor_id()) { + if ((error = start_ap(cpuid)) != 0) { + printf("AP #%d failed to start: %d\n", cpuid, error); + continue; + } + if (bootverbose) + printf("AP #%d started!\n", cpuid); } - - if (bootverbose) - printf("AP #%d started!\n", cpuid); - all_cpus |= 1 << cpuid; } Modified: head/sys/mips/rmi/xlr_machdep.c == --- head/sys/mips/rmi/xlr_machdep.c Sat Feb 12 01:03:15 2011 (r218590) +++ head/sys/mips/rmi/xlr_machdep.c Sat Feb 12 02:08:24 2011 (r218591) @@ -614,11 +614,11 @@ platform_processor_id(void) return (xlr_hwtid_to_cpuid[xlr_cpu_id()]); } -int -platform_num_processors(void) +cpumask_t +platform_cpu_mask(void) { - return (xlr_ncores * xlr_threads_per_core); + return (~0U >> (32 - (xlr_ncores * xlr_threads_per_core))); } struct cpu_group * Modified: head/sys/mips/sibyte/sb_scd.c == --- head/sys/mips/sibyte/sb_scd.c Sat Feb 12 01:03:15 2011 (r218590) +++ h
svn commit: r218592 - head/sys/vm
Author: jmallett Date: Sat Feb 12 02:10:08 2011 New Revision: 218592 URL: http://svn.freebsd.org/changeset/base/218592 Log: Use CPU_FOREACH rather than expecting CPUs 0 through mp_ncpus-1 to be present. Don't micro-optimize the uniprocessor case; use the same loop there. Submitted by: Bhanu Prakash Reviewed by: kib, jhb Modified: head/sys/vm/vm_meter.c Modified: head/sys/vm/vm_meter.c == --- head/sys/vm/vm_meter.c Sat Feb 12 02:08:24 2011(r218591) +++ head/sys/vm/vm_meter.c Sat Feb 12 02:10:08 2011(r218592) @@ -254,16 +254,12 @@ vcnt(SYSCTL_HANDLER_ARGS) { int count = *(int *)arg1; int offset = (char *)arg1 - (char *)&cnt; -#ifdef SMP int i; - for (i = 0; i < mp_ncpus; ++i) { + CPU_FOREACH(i) { struct pcpu *pcpu = pcpu_find(i); count += *(int *)((char *)&pcpu->pc_cnt + offset); } -#else - count += *(int *)((char *)PCPU_PTR(cnt) + offset); -#endif return (SYSCTL_OUT(req, &count, sizeof(int))); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r218594 - in head/sys/mips/cavium: . octe
Author: jmallett Date: Sat Feb 12 02:41:33 2011 New Revision: 218594 URL: http://svn.freebsd.org/changeset/base/218594 Log: 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. Modified: head/sys/mips/cavium/if_octm.c head/sys/mips/cavium/octe/ethernet-common.c Modified: head/sys/mips/cavium/if_octm.c == --- head/sys/mips/cavium/if_octm.c Sat Feb 12 02:14:19 2011 (r218593) +++ head/sys/mips/cavium/if_octm.c Sat Feb 12 02:41:33 2011 (r218594) @@ -64,6 +64,8 @@ #include #include +extern cvmx_bootinfo_t *octeon_bootinfo; + struct octm_softc { struct ifnet *sc_ifp; device_t sc_dev; @@ -173,10 +175,27 @@ octm_attach(device_t dev) return (ENXIO); } - mac = cvmx_mgmt_port_get_mac(sc->sc_port); - if (mac == CVMX_MGMT_PORT_GET_MAC_ERROR) { - device_printf(dev, "unable to read MAC.\n"); - return (ENXIO); + switch (cvmx_sysinfo_get()->board_type) { +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + /* +* The MR-730 uses its first two MACs for the management +* ports. +*/ + mac = 0; + memcpy((u_int8_t *)&mac + 2, octeon_bootinfo->mac_addr_base, + 6); + mac += sc->sc_port; + cvmx_mgmt_port_set_mac(sc->sc_port, mac); + break; +#endif + default: + mac = cvmx_mgmt_port_get_mac(sc->sc_port); + if (mac == CVMX_MGMT_PORT_GET_MAC_ERROR) { + device_printf(dev, "unable to read MAC.\n"); + return (ENXIO); + } + break; } /* No watermark for input ring. */ Modified: head/sys/mips/cavium/octe/ethernet-common.c == --- head/sys/mips/cavium/octe/ethernet-common.c Sat Feb 12 02:14:19 2011 (r218593) +++ head/sys/mips/cavium/octe/ethernet-common.c Sat Feb 12 02:41:33 2011 (r218594) @@ -279,6 +279,20 @@ int cvm_oct_common_init(struct ifnet *if octeon_bootinfo->mac_addr_base[5] + count}; cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + switch (cvmx_sysinfo_get()->board_type) { +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + /* +* The MR-730 uses its first two MACs for the management +* ports. +*/ + mac[5] += 2; + break; +#endif + default: + break; + } + ifp->if_mtu = ETHERMTU; count++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r218650 - head/games/fortune/datfiles
On Sat, Feb 19, 2011 at 11:29, Bruce Cran wrote: > On Saturday 19 February 2011 17:25:32 Carlos A. M. dos Santos wrote: > >> Did anybody complain about this? If not, would you mid either revert >> this commit or just go ahead and move all "potentially" offensive >> jokes to fortunes-o? Anything from Grouch Marx or Mark Twain will >> probably qualify. > > Yes, someone complained. From bin/137702: > > "A coworker pointed out a borderline offensive fortune that appeared in my > email signature which is partially generated from `fortune -s` output. > > [...] > > I agree that it's probably not appropriate in a professional setting." Professionally-appropriate is not the same as offensive, and such standards vary considerably more than ones for offensiveness. I don't think professionally-appropriate is the right standard for fortune. Certainly there's not really anything very professional about having a random E-Mail signature that's meant to amuse, for that matter. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r219693 - in head/sys/mips: include mips
Author: jmallett Date: Wed Mar 16 08:22:29 2011 New Revision: 219693 URL: http://svn.freebsd.org/changeset/base/219693 Log: o) Properly size caches and TLB on Octeon. o) Make COP0_SYNC do nothing on Octeon, which is fully interlocked. Submitted by: Bhanu Prakash (with modifications) Modified: head/sys/mips/include/cpuregs.h head/sys/mips/mips/cpu.c Modified: head/sys/mips/include/cpuregs.h == --- head/sys/mips/include/cpuregs.h Wed Mar 16 04:03:13 2011 (r219692) +++ head/sys/mips/include/cpuregs.h Wed Mar 16 08:22:29 2011 (r219693) @@ -198,12 +198,10 @@ #endif /* CPU dependent mtc0 hazard hook */ -#ifdef CPU_CNMIPS -#defineCOP0_SYNC nop; nop; nop; nop; nop; +#if defined(CPU_CNMIPS) || defined(CPU_RMI) +#defineCOP0_SYNC #elif defined(CPU_SB1) #define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop -#elif defined(CPU_RMI) -#define COP0_SYNC #else /* * Pick a reasonable default based on the "typical" spacing described in the @@ -571,6 +569,7 @@ * 16/1MIPS_COP_0_CONFIG1 ..33 Configuration register 1. * 16/2MIPS_COP_0_CONFIG2 ..33 Configuration register 2. * 16/3MIPS_COP_0_CONFIG3 ..33 Configuration register 3. + * 16/4 MIPS_COP_0_CONFIG4 ..33 Configuration register 4. * 17 MIPS_COP_0_LLADDR .336 Load Linked Address. * 18 MIPS_COP_0_WATCH_LO .336 WatchLo register. * 19 MIPS_COP_0_WATCH_HI .333 WatchHi register. @@ -656,7 +655,7 @@ #define MIPS_CONFIG1_TLBSZ_MASK0x7E00 /* bits 30..25 # tlb entries minus one */ #define MIPS_CONFIG1_TLBSZ_SHIFT 25 -#defineMIPS_MAX_TLB_ENTRIES64 +#defineMIPS_MAX_TLB_ENTRIES128 #define MIPS_CONFIG1_IS_MASK 0x01C0 /* bits 24..22 icache sets per way */ #define MIPS_CONFIG1_IS_SHIFT 22 @@ -679,6 +678,10 @@ #define MIPS_CONFIG1_EP0x0002 /* EJTAG implemented */ #define MIPS_CONFIG1_FP0x0001 /* FPU implemented */ +#define MIPS_CONFIG4_MMUSIZEEXT0x00FF /* bits 7.. 0 MMU Size Extension */ +#define MIPS_CONFIG4_MMUEXTDEF 0xC000 /* bits 15.14 MMU Extension Definition */ +#define MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT 0x4000 /* This values denotes CONFIG4 bits */ + /* * Values for the code field in a break instruction. */ Modified: head/sys/mips/mips/cpu.c == --- head/sys/mips/mips/cpu.cWed Mar 16 04:03:13 2011(r219692) +++ head/sys/mips/mips/cpu.cWed Mar 16 08:22:29 2011(r219693) @@ -52,6 +52,11 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(CPU_CNMIPS) +#include +#include +#endif + static void cpu_identify(void); struct mips_cpuinfo cpuinfo; @@ -70,6 +75,9 @@ mips_get_identity(struct mips_cpuinfo *c u_int32_t prid; u_int32_t cfg0; u_int32_t cfg1; +#if defined(CPU_CNMIPS) + u_int32_t cfg4; +#endif u_int32_t tmp; memset(cpuinfo, 0, sizeof(struct mips_cpuinfo)); @@ -96,6 +104,13 @@ mips_get_identity(struct mips_cpuinfo *c cpuinfo->tlb_nentries = ((cfg1 & MIPS_CONFIG1_TLBSZ_MASK) >> MIPS_CONFIG1_TLBSZ_SHIFT) + 1; + /* Add extended TLB size information from config4. */ +#if defined(CPU_CNMIPS) + cfg4 = mips_rd_config4(); + if ((cfg4 & MIPS_CONFIG4_MMUEXTDEF) == MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT) + cpuinfo->tlb_nentries += (cfg4 & MIPS_CONFIG4_MMUSIZEEXT) * 0x40; +#endif + /* L1 instruction cache. */ tmp = (cfg1 & MIPS_CONFIG1_IL_MASK) >> MIPS_CONFIG1_IL_SHIFT; if (tmp != 0) { @@ -103,10 +118,9 @@ mips_get_identity(struct mips_cpuinfo *c cpuinfo->l1.ic_nways = (((cfg1 & MIPS_CONFIG1_IA_MASK) >> MIPS_CONFIG1_IA_SHIFT)) + 1; cpuinfo->l1.ic_nsets = 1 << (((cfg1 & MIPS_CONFIG1_IS_MASK) >> MIPS_CONFIG1_IS_SHIFT) + 6); - cpuinfo->l1.ic_size = - cpuinfo->l1.ic_linesize * cpuinfo->l1.ic_nsets * cpuinfo->l1.ic_nways; } +#ifndef CPU_CNMIPS /* L1 data cache. */ tmp = (cfg1 & MIPS_CONFIG1_DL_MASK) >> MIPS_CONFIG1_DL_SHIFT; if (tmp != 0) { @@ -116,15 +130,36 @@ mips_get_identity(struct mips_cpuinfo *c cpuinfo->l1.dc_nsets = 1 << (((cfg1 & MIPS_CONFIG1_DS_MASK) >> MIPS_CONFIG1_DS_SHIFT) + 6); } -#ifdef CPU_CNMIPS +#else /* -* Octeon does 128 byte line-size. But Config-Sel1 doesn't show -* 128 line-size, 1 Set, 64 ways. +* Some Octeon cache configuration parameters are by model family, not +* config1. */ + if (OCTEON_IS_MODEL(OCTEON_CN3XXX)) { + /* Octeon and
svn commit: r219694 - in head/sys: contrib/octeon-sdk mips/cavium/octe
Author: jmallett Date: Wed Mar 16 08:51:36 2011 New Revision: 219694 URL: http://svn.freebsd.org/changeset/base/219694 Log: o) Clean up FPA pools on module unload. o) Allocate output buffer pool based on available output queues. Submitted by: Bhanu Prakash (with modifications) Modified: head/sys/contrib/octeon-sdk/cvmx-fpa.h head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Modified: head/sys/contrib/octeon-sdk/cvmx-fpa.h == --- head/sys/contrib/octeon-sdk/cvmx-fpa.h Wed Mar 16 08:22:29 2011 (r219693) +++ head/sys/contrib/octeon-sdk/cvmx-fpa.h Wed Mar 16 08:51:36 2011 (r219694) @@ -154,6 +154,19 @@ static inline void cvmx_fpa_enable(void) } /** + * Reset FPA to disable. Make sure buffers from all FPA pools are freed + * before disabling FPA. + */ +static inline void cvmx_fpa_disable(void) +{ +cvmx_fpa_ctl_status_t status; + +status.u64 = cvmx_read_csr(CVMX_FPA_CTL_STATUS); +status.s.reset = 1; +cvmx_write_csr(CVMX_FPA_CTL_STATUS, status.u64); +} + +/** * Get a new block from the FPA * * @param pool Pool to get the block from Modified: head/sys/mips/cavium/octe/ethernet.c == --- head/sys/mips/cavium/octe/ethernet.cWed Mar 16 08:22:29 2011 (r219693) +++ head/sys/mips/cavium/octe/ethernet.cWed Mar 16 08:51:36 2011 (r219694) @@ -98,6 +98,11 @@ struct ifnet *cvm_oct_device[TOTAL_NUMBE */ static struct taskqueue *cvm_oct_link_taskq; +/* + * Number of buffers in output buffer pool. + */ +static int cvm_oct_num_output_buffers; + /** * Function to update link status. */ @@ -185,13 +190,13 @@ static void cvm_do_timer(void *arg) } } - /** * Configure common hardware for all interfaces */ static void cvm_oct_configure_common_hw(device_t bus) { struct octebus_softc *sc; + int pko_queues; int error; int rid; @@ -199,13 +204,34 @@ static void cvm_oct_configure_common_hw( /* Setup the FPA */ cvmx_fpa_enable(); - cvm_oct_mem_fill_fpa(CVMX_FPA_PACKET_POOL, CVMX_FPA_PACKET_POOL_SIZE, num_packet_buffers); - cvm_oct_mem_fill_fpa(CVMX_FPA_WQE_POOL, CVMX_FPA_WQE_POOL_SIZE, num_packet_buffers); - if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL) - cvm_oct_mem_fill_fpa(CVMX_FPA_OUTPUT_BUFFER_POOL, CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE, 128); + cvm_oct_mem_fill_fpa(CVMX_FPA_PACKET_POOL, CVMX_FPA_PACKET_POOL_SIZE, +num_packet_buffers); + cvm_oct_mem_fill_fpa(CVMX_FPA_WQE_POOL, CVMX_FPA_WQE_POOL_SIZE, +num_packet_buffers); + if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL) { + /* +* If the FPA uses different pools for output buffers and +* packets, size the output buffer pool based on the number +* of PKO queues. +*/ + if (OCTEON_IS_MODEL(OCTEON_CN38XX)) + pko_queues = 128; + else if (OCTEON_IS_MODEL(OCTEON_CN3XXX)) + pko_queues = 32; + else if (OCTEON_IS_MODEL(OCTEON_CN50XX)) + pko_queues = 32; + else + pko_queues = 256; + + cvm_oct_num_output_buffers = 4 * pko_queues; + cvm_oct_mem_fill_fpa(CVMX_FPA_OUTPUT_BUFFER_POOL, +CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE, +cvm_oct_num_output_buffers); + } if (USE_RED) - cvmx_helper_setup_red(num_packet_buffers/4, num_packet_buffers/8); + cvmx_helper_setup_red(num_packet_buffers/4, + num_packet_buffers/8); /* Enable the MII interface */ if (!octeon_is_simulation()) @@ -303,11 +329,13 @@ int cvm_oct_init_module(device_t bus) int num_ports = cvmx_helper_ports_on_interface(interface); int port; - for (port = cvmx_helper_get_ipd_port(interface, 0); port < cvmx_helper_get_ipd_port(interface, num_ports); port++) { + for (port = 0; port < num_ports; port++) { cvmx_pip_prt_tagx_t pip_prt_tagx; - pip_prt_tagx.u64 = cvmx_read_csr(CVMX_PIP_PRT_TAGX(port)); + int pkind = cvmx_helper_get_ipd_port(interface, port); + + pip_prt_tagx.u64 = cvmx_read_csr(CVMX_PIP_PRT_TAGX(pkind)); pip_prt_tagx.s.grp = pow_receive_group; - cvmx_write_csr(CVMX_PIP_PRT_TAGX(port), pip_prt_tagx.u64); + cvmx_write_csr(CVMX_PIP_PRT_TAGX(pkind), pip_prt_tagx.u64); } } @@ -475,4 +503,13 @@ void cvm
svn commit: r219695 - head/sys/mips/cavium/octe
Author: jmallett Date: Wed Mar 16 08:56:22 2011 New Revision: 219695 URL: http://svn.freebsd.org/changeset/base/219695 Log: o) Tear down receive interrupt on detach. Submitted by: Bhanu Prakash Modified: head/sys/mips/cavium/octe/ethernet-common.h head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octe/octebus.c head/sys/mips/cavium/octe/octebusvar.h Modified: head/sys/mips/cavium/octe/ethernet-common.h == --- head/sys/mips/cavium/octe/ethernet-common.h Wed Mar 16 08:51:36 2011 (r219694) +++ head/sys/mips/cavium/octe/ethernet-common.h Wed Mar 16 08:56:22 2011 (r219695) @@ -39,7 +39,7 @@ void cvm_oct_common_set_multicast_list(s void cvm_oct_common_set_mac_address(struct ifnet *ifp, const void *); int cvm_oct_init_module(device_t); -void cvm_oct_cleanup_module(void); +void cvm_oct_cleanup_module(device_t); /* * XXX/juli Modified: head/sys/mips/cavium/octe/ethernet.c == --- head/sys/mips/cavium/octe/ethernet.cWed Mar 16 08:51:36 2011 (r219694) +++ head/sys/mips/cavium/octe/ethernet.cWed Mar 16 08:56:22 2011 (r219695) @@ -250,7 +250,7 @@ static void cvm_oct_configure_common_hw( error = bus_setup_intr(bus, sc->sc_rx_irq, INTR_TYPE_NET | INTR_MPSAFE, cvm_oct_do_interrupt, NULL, cvm_oct_device, - NULL); + &sc->sc_rx_intr_cookie); if (error != 0) { device_printf(bus, "could not setup workq irq"); return; @@ -473,17 +473,16 @@ int cvm_oct_init_module(device_t bus) * * @return Zero on success */ -void cvm_oct_cleanup_module(void) +void cvm_oct_cleanup_module(device_t bus) { int port; + struct octebus_softc *sc = device_get_softc(bus); /* Disable POW interrupt */ cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0); -#if 0 /* Free the interrupt handler */ - free_irq(8 + pow_receive_group, cvm_oct_device); -#endif + bus_teardown_intr(bus, sc->sc_rx_irq, sc->sc_rx_intr_cookie); callout_stop(&cvm_oct_poll_timer); cvm_oct_rx_shutdown(); Modified: head/sys/mips/cavium/octe/octebus.c == --- head/sys/mips/cavium/octe/octebus.c Wed Mar 16 08:51:36 2011 (r219694) +++ head/sys/mips/cavium/octe/octebus.c Wed Mar 16 08:56:22 2011 (r219695) @@ -112,7 +112,7 @@ octebus_attach(device_t dev) static int octebus_detach(device_t dev) { - cvm_oct_cleanup_module(); + cvm_oct_cleanup_module(dev); return (0); } Modified: head/sys/mips/cavium/octe/octebusvar.h == --- head/sys/mips/cavium/octe/octebusvar.h Wed Mar 16 08:51:36 2011 (r219694) +++ head/sys/mips/cavium/octe/octebusvar.h Wed Mar 16 08:56:22 2011 (r219695) @@ -33,6 +33,7 @@ struct octebus_softc { device_t sc_dev; struct resource *sc_rx_irq; + void *sc_rx_intr_cookie; struct resource *sc_rgmii_irq; struct resource *sc_spi_irq; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r219706 - in head/sys/mips/cavium: . octe
Author: jmallett Date: Wed Mar 16 22:51:34 2011 New Revision: 219706 URL: http://svn.freebsd.org/changeset/base/219706 Log: 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) Modified: head/sys/mips/cavium/if_octm.c head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-common.h head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/if_octm.c == --- head/sys/mips/cavium/if_octm.c Wed Mar 16 20:54:58 2011 (r219705) +++ head/sys/mips/cavium/if_octm.c Wed Mar 16 22:51:34 2011 (r219706) @@ -175,28 +175,13 @@ octm_attach(device_t dev) return (ENXIO); } - switch (cvmx_sysinfo_get()->board_type) { -#if defined(OCTEON_VENDOR_LANNER) - case CVMX_BOARD_TYPE_CUST_LANNER_MR730: - /* -* The MR-730 uses its first two MACs for the management -* ports. -*/ - mac = 0; - memcpy((u_int8_t *)&mac + 2, octeon_bootinfo->mac_addr_base, - 6); - mac += sc->sc_port; - cvmx_mgmt_port_set_mac(sc->sc_port, mac); - break; -#endif - default: - mac = cvmx_mgmt_port_get_mac(sc->sc_port); - if (mac == CVMX_MGMT_PORT_GET_MAC_ERROR) { - device_printf(dev, "unable to read MAC.\n"); - return (ENXIO); - } - break; - } + /* +* Set MAC address for this management port. +*/ + mac = 0; + memcpy((u_int8_t *)&mac + 2, octeon_bootinfo->mac_addr_base, 6); + mac += sc->sc_port; + cvmx_mgmt_port_set_mac(sc->sc_port, mac); /* No watermark for input ring. */ mixx_irhwm.u64 = 0; Modified: head/sys/mips/cavium/octe/ethernet-common.c == --- head/sys/mips/cavium/octe/ethernet-common.c Wed Mar 16 20:54:58 2011 (r219705) +++ head/sys/mips/cavium/octe/ethernet-common.c Wed Mar 16 22:51:34 2011 (r219706) @@ -269,34 +269,19 @@ void cvm_oct_common_poll(struct ifnet *i */ int cvm_oct_common_init(struct ifnet *ifp) { - static int count; char mac[6] = { octeon_bootinfo->mac_addr_base[0], octeon_bootinfo->mac_addr_base[1], octeon_bootinfo->mac_addr_base[2], octeon_bootinfo->mac_addr_base[3], octeon_bootinfo->mac_addr_base[4], - octeon_bootinfo->mac_addr_base[5] + count}; + octeon_bootinfo->mac_addr_base[5] }; cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - switch (cvmx_sysinfo_get()->board_type) { -#if defined(OCTEON_VENDOR_LANNER) - case CVMX_BOARD_TYPE_CUST_LANNER_MR730: - /* -* The MR-730 uses its first two MACs for the management -* ports. -*/ - mac[5] += 2; - break; -#endif - default: - break; - } + mac[5] += cvm_oct_mac_addr_offset++; ifp->if_mtu = ETHERMTU; - count++; - cvm_oct_mdio_setup_device(ifp); cvm_oct_common_set_mac_address(ifp, mac); Modified: head/sys/mips/cavium/octe/ethernet-common.h == --- head/sys/mips/cavium/octe/ethernet-common.h Wed Mar 16 20:54:58 2011 (r219705) +++ head/sys/mips/cavium/octe/ethernet-common.h Wed Mar 16 22:51:34 2011 (r219706) @@ -51,3 +51,5 @@ int cvm_oct_sgmii_init(struct ifnet *ifp int cvm_oct_spi_init(struct ifnet *ifp); void cvm_oct_spi_uninit(struct ifnet *ifp); int cvm_oct_xaui_init(struct ifnet *ifp); + +extern unsigned int cvm_oct_mac_addr_offset; Modified: head/sys/mips/cavium/octe/ethernet.c == --- head/sys/mips/cavium/octe/ethernet.cWed Mar 16 20:54:58 2011 (r219705) +++ head/sys/mips/cavium/octe/ethernet.cWed Mar 16 22:51:34 2011 (r219706) @@ -103,6 +103,15 @@ static struct taskqueue *cvm_oct_link_ta */ static int cvm_oct_num_output_buffers; +/* + * The offset from mac_addr_base that should be used for the next port + * that is configured. By convention, if any mgmt ports exist on the + * chip, they get the first mac addresses. The ports controlled by + * this driver are numbered sequencially following any mgmt addresses + * that may exist. + */ +unsigned int cvm_oct_mac_addr_offset; + /** * Function to update link status. */ @@ -318,6 +327,20 @@ int cvm_oct_init_module(device_t bus) printf("cavi
Re: svn commit: r219753 - head/sys/dev/e1000
On Fri, Mar 18, 2011 at 11:54, Jack F Vogel wrote: > Author: jfv > Date: Fri Mar 18 18:54:00 2011 > New Revision: 219753 > URL: http://svn.freebsd.org/changeset/base/219753 > > Log: > This delta updates the em driver to version 7.2.2 which has > been undergoing test for some weeks. This improves the RX > mbuf handling to avoid system hang due to depletion. Thanks > to all those who have been testing the code, and to Beezar > Liu for the design changes. I understand that the fundamental unit coming out of Intel is an atomic driver version, but it really, really, really would be nice to not fix functional and stylistic changes at such a fundamental level and with such a widely-used driver as these. I understand that you have enough work already, but if it's at all possible to do these updates in a couple of passes, I would really appreciate it, and I know there are other people who have to mine the significant deltas from these updates who would appreciate it, too. You could start with stylistic changes and then do a couple of functional changes and then update the driver version to reflect the Intel finished product, say. It's good that it's been undergoing a long period of test, but it would have been nice if the commit message had included more details on the functional changes. Some specific comments: It seems like the update to e1000_82575 (and other chip-specific bits) is totally independent of the other style changes and the depletion fix and that it would have been easy to do that separately. > - if (nvm->word_size == (1 << 15)) { > + if (nvm->word_size == (1 << 15)) > nvm->page_size = 128; > - } > - Great that this is moving towards KNF. Might be good to take a few minutes and fix all such statements now rather than doing them in pieces later in time. > -#define E1000_DMACR_DMACTHR_MASK 0x00FF /* DMA Coalescing Receive > +#define E1000_DMACR_DMACTHR_MASK 0x00FF /* DMA Coalescing Rx > * Threshold */ All of these changes could have easily been done separately since they are entirely stylistic. > +/* Energy efficient ethernet - default to OFF */ > +static int eee_setting = 0; > +TUNABLE_INT("hw.em.eee_setting", &eee_setting); Would have been useful to see some mention of this in the commit message. > + struct e1000_hw *hw; > int error = 0; > > INIT_DEBUGOUT("em_attach: begin"); > > adapter = device_get_softc(dev); > adapter->dev = adapter->osdep.dev = dev; > + hw = &adapter->hw; [...] > - if ((adapter->hw.mac.type == e1000_ich8lan) || > - (adapter->hw.mac.type == e1000_ich9lan) || > - (adapter->hw.mac.type == e1000_ich10lan) || > - (adapter->hw.mac.type == e1000_pchlan) || > - (adapter->hw.mac.type == e1000_pch2lan)) { > + if ((hw->mac.type == e1000_ich8lan) || > + (hw->mac.type == e1000_ich9lan) || > + (hw->mac.type == e1000_ich10lan) || > + (hw->mac.type == e1000_pchlan) || > + (hw->mac.type == e1000_pch2lan)) { Like the brace changes elsewhere, this is not the first time this stylistic improvement has been made in the e1000 code base. Perhaps it would be good to replace all uses of adapter->hw. with hw-> and add the appropriate hw variables now. It seems insignificant, but I assure you it is a source of conflicts for those of us who have to maintain local changes to e1000. That's alright as a one time cost, and it would seem worthwhile to fix this universally since that's the direction this driver and the Linux driver seem to be going in. > - bool more; > > > if (ifp->if_drv_flags & IFF_DRV_RUNNING) { > - more = em_rxeof(rxr, adapter->rx_process_limit, NULL); > - > + bool more = em_rxeof(rxr, adapter->rx_process_limit, NULL); This seems like a style regression, at least by FreeBSD standards. > - for (int i = 0; i < j; ++i) { > + for (int i = 0, n = 0; i < q; ++i) { Why is n being initialized to 0 when it will be set immediately below? Even if it were necessary, putting it in the for statement is only an obfuscatory eye-sore, doubly so since it has nothing to do with the loop construct as far as I can tell. > rxr = &adapter->rx_rings[i]; > - for (int n = 0; n < adapter->num_rx_desc; n++) { > + n = rxr->next_to_check; ^^^ Here n is set. > + while(n != rxr->next_to_refresh) { ^^^ Here n is used in a while missing a very small amount of whitespace. > + while(i != rxr->next_to_refresh) { ^^^ Similar. > - Copyright (c) 2001-2011, Intel Corporation > + Copyright (c) 2001-2010, Intel Corporation This seems like a step backwards. Through time. > +/* > +** DMA Coalescing, only for i350 - default to off, > +** this feature is for power savings > +*/ > +static int igb_dma_coalesce = FALSE;
svn commit: r219899 - head/sbin/dumpfs
Author: jmallett Date: Wed Mar 23 08:33:12 2011 New Revision: 219899 URL: http://svn.freebsd.org/changeset/base/219899 Log: Add support for displaying newfs flags for SU+J and TRIM. Modified: head/sbin/dumpfs/dumpfs.c Modified: head/sbin/dumpfs/dumpfs.c == --- head/sbin/dumpfs/dumpfs.c Wed Mar 23 08:27:57 2011(r219898) +++ head/sbin/dumpfs/dumpfs.c Wed Mar 23 08:33:12 2011(r219899) @@ -402,7 +402,9 @@ marshal(const char *name) printf("-g %d ", fs->fs_avgfilesize); printf("-h %d ", fs->fs_avgfpdir); /* -i is dumb */ - /* -j..l unimplemented */ + if (fs->fs_flags & FS_SUJ) + printf("-j "); + /* -k..l unimplemented */ printf("-m %d ", fs->fs_minfree); /* -n unimplemented */ printf("-o "); @@ -419,6 +421,8 @@ marshal(const char *name) } /* -p..r unimplemented */ printf("-s %jd ", (intmax_t)fsbtodb(fs, fs->fs_size)); + if (fs->fs_flags & FS_TRIM) + printf("-t "); printf("%s ", disk.d_name); printf("\n"); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r220260 - head/sys/mips/atheros
On Fri, Apr 1, 2011 at 20:48, Adrian Chadd wrote: > Author: adrian > Date: Sat Apr 2 03:48:15 2011 > New Revision: 220260 > URL: http://svn.freebsd.org/changeset/base/220260 > > Log: > A handful of the openwrt devices use a MAC address that's at a hard-coded > offset in the flash. > > Some devices (eg the TPLink WR-1043ND) don't have a flash environment > partition which can be queried for the current board settings. > > This particular workaround allows for image creators to use a hint > to set the base MAC address. For example: > > hint.arge.0.eeprommac=0x1f01fc00 It isn't obvious from the wording here that it's the address of the MAC in flash, it sounds like it's the base MAC-address. Might be useful to add "phys" or "pa" or something to suggest that it's a physical address in RAM. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r220401 - in head: . share/mk tools/build/mk tools/build/options
On Wed, Apr 6, 2011 at 14:04, Alexander Best wrote: > On Wed Apr 6 11, Ulrich Spoerlein wrote: >> Author: uqs >> Date: Wed Apr 6 20:08:23 2011 >> New Revision: 220401 >> URL: http://svn.freebsd.org/changeset/base/220401 >> >> Log: >> Complete WITHOUT_CXX support. It implies WITHOUT_GROFF and >> WITHOUT_CLANG. > > is there no way to build clang/llvm without CXX support? Clang and LLVM are written in C++. Even if their support for compiling C++ could be disabled, you'd still need a C++ cross-compiler to build them, which ought to be disabled by WITHOUT_CXX, right? ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r190233 - head/sys/netinet
Author: jmallett Date: Sun Mar 22 00:45:47 2009 New Revision: 190233 URL: http://svn.freebsd.org/changeset/base/190233 Log: Remove local in6_addr variables for local and foreign addresses in sysctl_drop, they were passed uninitialized to in6_pcblookup_hash. Instead, do as is done for IPv4 and use the addresses within the sockaddr structure, which are correctly populated. This fixes tcpdrop(8) for IPv6 address pairs. Reviewed by: bz Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c == --- head/sys/netinet/tcp_subr.c Sun Mar 22 00:29:48 2009(r190232) +++ head/sys/netinet/tcp_subr.c Sun Mar 22 00:45:47 2009(r190233) @@ -2114,7 +2114,6 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) struct sockaddr_in *fin, *lin; #ifdef INET6 struct sockaddr_in6 *fin6, *lin6; - struct in6_addr f6, l6; #endif int error; @@ -2174,8 +2173,9 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) switch (addrs[0].ss_family) { #ifdef INET6 case AF_INET6: - inp = in6_pcblookup_hash(&V_tcbinfo, &f6, fin6->sin6_port, - &l6, lin6->sin6_port, 0, NULL); + inp = in6_pcblookup_hash(&V_tcbinfo, &fin6->sin6_addr, + fin6->sin6_port, &lin6->sin6_addr, lin6->sin6_port, 0, + NULL); break; #endif case AF_INET: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r190346 - head/sys/dev/iwn
Author: jmallett Date: Tue Mar 24 00:08:58 2009 New Revision: 190346 URL: http://svn.freebsd.org/changeset/base/190346 Log: Remove gratuitous unlock in error case. Reviewed by: sam Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c == --- head/sys/dev/iwn/if_iwn.c Tue Mar 24 00:07:17 2009(r190345) +++ head/sys/dev/iwn/if_iwn.c Tue Mar 24 00:08:58 2009(r190346) @@ -2134,7 +2134,6 @@ iwn_start_locked(struct ifnet *ifp) if (iwn_tx_data(sc, m, ni, txq) != 0) { ifp->if_oerrors++; ieee80211_free_node(ni); - IWN_UNLOCK(sc); break; } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r190458 - head/sys/dev/wpi
Author: jmallett Date: Fri Mar 27 03:17:25 2009 New Revision: 190458 URL: http://svn.freebsd.org/changeset/base/190458 Log: o) Check that no overrun or CRC errors were encountered in receiving a packet. Linux, OpenBSD and our iwn(4) all do this. It also results in a huge performance improvement (and the rejection of a fair number of apparently-bad packets on receive) on my hardware. o) Like the wpi(4) driver in OpenBSD, and like our iwn(4), also drop runt packets. o) Don't bother doing IFQ_POLL and then IFQ_DRV_DEQUEUE, just do IFQ_DRV_DEQUEUE outright. This is more similar to how OpenBSD and our iwn(4) work. Reviewed by: sam Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpireg.h Modified: head/sys/dev/wpi/if_wpi.c == --- head/sys/dev/wpi/if_wpi.c Thu Mar 26 22:54:19 2009(r190457) +++ head/sys/dev/wpi/if_wpi.c Fri Mar 27 03:17:25 2009(r190458) @@ -1473,6 +1473,20 @@ wpi_rx_intr(struct wpi_softc *sc, struct le16toh(head->len), (int8_t)stat->rssi, head->rate, head->chan, (uintmax_t)le64toh(tail->tstamp))); + /* discard Rx frames with bad CRC early */ + if ((le32toh(tail->flags) & WPI_RX_NOERROR) != WPI_RX_NOERROR) { + DPRINTFN(WPI_DEBUG_RX, ("%s: rx flags error %x\n", __func__, + le32toh(tail->flags))); + ifp->if_ierrors++; + return; + } + if (le16toh(head->len) < sizeof (struct ieee80211_frame)) { + DPRINTFN(WPI_DEBUG_RX, ("%s: frame too short: %d\n", __func__, + le16toh(head->len))); + ifp->if_ierrors++; + return; + } + /* XXX don't need mbuf, just dma buffer */ mnew = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); if (mnew == NULL) { @@ -2029,7 +2043,7 @@ wpi_start_locked(struct ifnet *ifp) return; for (;;) { - IFQ_POLL(&ifp->if_snd, m); + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; /* no QoS encapsulation for EAPOL frames */ @@ -2040,7 +2054,6 @@ wpi_start_locked(struct ifnet *ifp) ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; m = ieee80211_encap(ni, m); if (m == NULL) { Modified: head/sys/dev/wpi/if_wpireg.h == --- head/sys/dev/wpi/if_wpireg.hThu Mar 26 22:54:19 2009 (r190457) +++ head/sys/dev/wpi/if_wpireg.hFri Mar 27 03:17:25 2009 (r190458) @@ -235,12 +235,10 @@ struct wpi_rx_head { struct wpi_rx_tail { uint32_tflags; -#if 0 #define WPI_RX_NO_CRC_ERR (1 << 0) #define WPI_RX_NO_OVFL_ERR (1 << 1) /* shortcut for the above */ #define WPI_RX_NOERROR (WPI_RX_NO_CRC_ERR | WPI_RX_NO_OVFL_ERR) -#endif uint64_ttstamp; uint32_ttbeacon; } __packed; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r190462 - head/sys/dev/wpi
Author: jmallett Date: Fri Mar 27 05:44:53 2009 New Revision: 190462 URL: http://svn.freebsd.org/changeset/base/190462 Log: Put the "%d retries" debug message in the transmit path behind WPI_DEBUG_TX rather than behind a seemingly accidental constant likely left over from one of the related drivers which uses log levels rather than per-facility debugging flags. This should get rid of contextless messages on the console for people who have not set (or cleared the default) debugging flags. Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c == --- head/sys/dev/wpi/if_wpi.c Fri Mar 27 05:35:12 2009(r190461) +++ head/sys/dev/wpi/if_wpi.c Fri Mar 27 05:44:53 2009(r190462) @@ -1587,7 +1587,7 @@ wpi_tx_intr(struct wpi_softc *sc, struct */ wn->amn.amn_txcnt++; if (stat->ntries > 0) { - DPRINTFN(3, ("%d retries\n", stat->ntries)); + DPRINTFN(WPI_DEBUG_TX, ("%d retries\n", stat->ntries)); wn->amn.amn_retrycnt++; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r191197 - head/share/misc
On Fri, Apr 17, 2009 at 1:01 AM, Kevin Lo wrote: > Log: > Change Taiwan, Province of China to Taiwan, Republic of China > > Modified: > head/share/misc/iso3166 Do you have a source for this change? The ISO sites I've checked don't support it. For example: http://www.iso.org/iso/iso-3166-1_decoding_table And no obvious recent name change item on the "What's new?" page: http://www.iso.org/iso/country_codes/check_what_s_new.htm ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r191197 - head/share/misc
On Fri, Apr 17, 2009 at 2:10 AM, Kevin Lo wrote: > Juli Mallett wrote: >> On Fri, Apr 17, 2009 at 1:01 AM, Kevin Lo wrote: >> > Log: >> > Change Taiwan, Province of China to Taiwan, Republic of China >> > >> > Modified: >> > head/share/misc/iso3166 >> >> Do you have a source for this change? The ISO sites I've checked >> don't support it. For example: >> >> http://www.iso.org/iso/iso-3166-1_decoding_table >> >> And no obvious recent name change item on the "What's new?" page: >> >> http://www.iso.org/iso/country_codes/check_what_s_new.htm > > This is a highly political issue. You wouldn't like the US to be > referred to as "United States, province of Britain.". Indeed. However politics have no place in accurate representation of standards. The place to create such a change is at the ISO, rather than making FreeBSD inaccurate. Likewise, please do not change any standards-defined references to Mongolia to imply that it is a part of the Republic of China unless the standard involved says it is. If something isn't defined by a standards body, arguments of a political nature about the merit of the change might be relevant. In this case, the file's contents are to reflect ISO reality, not any other reality. Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r191898 - head/sys/compat/linux
Worth remembering: the difference is not just that their sizes may (often do) differ. size_t is unsigned. ssize_t is signed. An unqualified int is signed. On Thu, May 7, 2009 at 12:46 PM, Jamie Gritton wrote: > Author: jamie > Date: Thu May 7 19:46:29 2009 > New Revision: 191898 > URL: http://svn.freebsd.org/changeset/base/191898 > > Log: > Give vfs_getopt the type it's expecting. > Write 100 times: "32 bits is so twentieth century." > > Noticed by: dchagin > > Modified: > head/sys/compat/linux/linux_mib.c > > Modified: head/sys/compat/linux/linux_mib.c > == > --- head/sys/compat/linux/linux_mib.c Thu May 7 19:17:06 2009 > (r191897) > +++ head/sys/compat/linux/linux_mib.c Thu May 7 19:46:29 2009 > (r191898) > @@ -223,8 +223,7 @@ linux_prison_check(void *obj __unused, v > { > struct vfsoptlist *opts = data; > char *osname, *osrelease; > - size_t len; > - int error, oss_version; > + int error, len, oss_version; > > /* Check that the parameters are correct. */ > (void)vfs_flagopt(opts, "linux", NULL, 0); > @@ -263,8 +262,7 @@ linux_prison_set(void *obj, void *data) > struct prison *pr = obj; > struct vfsoptlist *opts = data; > char *osname, *osrelease; > - size_t len; > - int error, gotversion, nolinux, oss_version, yeslinux; > + int error, gotversion, len, nolinux, oss_version, yeslinux; > > /* Set the parameters, which should be correct. */ > yeslinux = vfs_flagopt(opts, "linux", NULL, 0); > ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r252913 - head/sys/arm/ti/am335x
Thanks for this and the other commits, Oleksandr! Much appreciated. Looking forward to giving it a spin on my BeagleBones Black! On Sat, Jul 6, 2013 at 9:22 PM, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Sun Jul 7 04:22:08 2013 > New Revision: 252913 > URL: http://svnweb.freebsd.org/changeset/base/252913 > > Log: > - Add USBSS driver for AM335x SoC. Driver is a wrapper around Mentors > Graphic > USB OTG core. > > Added: > head/sys/arm/ti/am335x/am335x_usbss.c (contents, props changed) > Modified: > head/sys/arm/ti/am335x/files.am335x > > Added: head/sys/arm/ti/am335x/am335x_usbss.c > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/ti/am335x/am335x_usbss.c Sun Jul 7 04:22:08 2013 > (r252913) > @@ -0,0 +1,481 @@ > +/*- > + * Copyright (c) 2013 Oleksandr Tymoshenko > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + *notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *notice, this list of conditions and the following disclaimer in the > + *documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#defineUSB_DEBUG_VAR usbssdebug > + > +#include > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > + > +#defineAM335X_USB_PORTS2 > + > +#defineUSBSS_REVREG0x00 > +#defineUSBSS_SYSCONFIG 0x10 > +#defineUSBSS_SYSCONFIG_SRESET 1 > + > +#define USBCTRL_REV0x00 > +#define USBCTRL_CTRL 0x14 > +#define USBCTRL_STAT 0x18 > +#define USBCTRL_IRQ_STAT0 0x30 > +#defineIRQ_STAT0_RXSHIFT 16 > +#defineIRQ_STAT0_TXSHIFT 0 > +#define USBCTRL_IRQ_STAT1 0x34 > +#defineIRQ_STAT1_DRVVBUS (1 << 8) > +#define USBCTRL_INTEN_SET0 0x38 > +#define USBCTRL_INTEN_SET1 0x3C > +#defineUSBCTRL_INTEN_USB_ALL 0x1ff > +#defineUSBCTRL_INTEN_USB_SOF (1 << 3) > +#define USBCTRL_INTEN_CLR0 0x40 > +#define USBCTRL_INTEN_CLR1 0x44 > +#define USBCTRL_UTMI 0xE0 > +#defineUSBCTRL_UTMI_FSDATAEXT (1 << 1) > +#define USBCTRL_MODE 0xE8 > +#defineUSBCTRL_MODE_IDDIG (1 << 8) > +#defineUSBCTRL_MODE_IDDIGMUX (1 << 7) > + > +/* USBSS resource + 2 MUSB ports */ > + > +#define RES_USBSS 0 > +#define RES_USBCTRL(i) (3*i+1) > +#define RES_USBPHY(i) (3*i+2) > +#define RES_USBCORE(i) (3*i+3) > + > +#defineUSB_WRITE4(sc, idx, reg, val) do {\ > + bus_write_4((sc)->sc_mem_res[idx], (reg), (val)); \ > +} while (0) > + > +#defineUSB_READ4(sc, idx, reg) bus_read_4((sc)->sc_mem_res[idx], > (reg)) > + > +#defineUSBSS_WRITE4(sc, reg, val) \ > +USB_WRITE4((sc), RES_USBSS, (reg), (val)) > +#defineUSBSS_READ4(sc, reg)\ > +USB_READ4((sc), RES_USBSS, (reg)) > +#defineUSBCTRL_WRITE4(sc, unit, reg, val) \ > +USB_WRITE4((sc), RES_USBCTRL(unit), (reg), (val)) > +#defineUSBCTRL_READ4(sc, unit, reg)\ > +USB_READ4((sc), RES_USBCTRL(unit), (reg)) > +#defineUSBPHY_WRITE4(sc, unit, reg, val) \ > +USB_WRITE4((sc), RES_USBPHY(unit), (reg), (val)) > +#defineUSBPHY_READ4(sc, unit, reg) \ >
Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc
On Fri, Jul 26, 2013 at 2:26 PM, Andrey Zonov wrote: > On 7/26/13 8:09 AM, Jilles Tjoelker wrote: > > On Fri, Jul 26, 2013 at 02:00:07AM +, Andrey Zonov wrote: > >> Author: zont > >> Date: Fri Jul 26 02:00:06 2013 > >> New Revision: 253662 > >> URL: http://svnweb.freebsd.org/changeset/base/253662 > > > >> Log: > >> Remove define and documentation for vm_pageout_algorithm missed in > r253587 > > > >> Modified: > >> head/lib/libc/gen/sysctl.3 > >> head/sys/vm/vm_param.h > >> head/tools/tools/sysdoc/tunables.mdoc > > > >> Modified: head/sys/vm/vm_param.h > >> > == > >> --- head/sys/vm/vm_param.h Fri Jul 26 00:28:19 2013(r253661) > >> +++ head/sys/vm/vm_param.h Fri Jul 26 02:00:06 2013(r253662) > >> @@ -82,9 +82,8 @@ > >> #define VM_V_CACHE_MIN 7 /* cnt.v_cache_min */ > >> #define VM_V_CACHE_MAX 8 /* cnt.v_cache_max */ > >> #define VM_V_PAGEOUT_FREE_MIN 9 /* cnt.v_pageout_free_min > */ > >> -#define VM_PAGEOUT_ALGORITHM10 /* pageout algorithm */ > >> -#define VM_SWAPPING_ENABLED 11 /* swapping enabled */ > >> -#define VM_MAXID12 /* number of valid vm ids > */ > >> +#define VM_SWAPPING_ENABLED 10 /* swapping enabled */ > >> +#define VM_MAXID11 /* number of valid vm ids > */ > > > > As noted in mail from Bruce Evans, please preserve the ABI of > > VM_SWAPPING_ENABLED here. > > > > I don't think it's a big problem. Internally we don't use it. Good > code uses sysctlbyname() instead of sysctl(). It doesn't seem to me > this is very popular sysctl. It's also CURRENT without MFC. That doesn't seem like a great argument. Why should we break the ABI for bad code that used that sysctl and all following? It seems pretty trivial to preserve, and no-cost. Also, the fact that it's in current misses the point completely: it breaks ABI with older binaries, namely older binaries running on -CURRENT. And not just for that field. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
On Thu, Apr 11, 2013 at 11:00 AM, Gleb Smirnoff wrote: > Bruce, > > On Thu, Apr 11, 2013 at 09:07:25PM +1000, Bruce Evans wrote: > B> Just routine avoidance of namespace pollution. This is easy in such a > B> simple header. > > Sorry, with all respect, but I can't call including sys/types.h > a namespace pollution. > > Ok, even you force me to name it that way, still I would prefer > namespace pollution instead of handmade copy pasted typedefs. But Gleb, making such changes unilaterally is a bit of a leap. The project has mostly accepted Bruce's wisdom about trying to minimize and reduce namespace pollution. Now, this isn't a standard header so it's quite a bit less of a concern, but it's not no concern. If you think that we should reverse our trend on including namespace-polluting headers in system headers, we should discuss that on arch@, and it shouldn't be something that's done without any discussion or consideration. Should we expect further changes of this nature (and of the proposed nature removing __size_t and __ssize_t use) if you make changes to other headers as part of your work? Are you going to add to every header currently using in a single go, or will you be doing that a little at a time when making functional changes? Thanks, Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r249484 - head/lib
On Tue, Apr 16, 2013 at 11:00 PM, Tim Kientzle wrote: > > On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: > >> On 2013-04-14 21:13, Tim Kientzle wrote: >>> Author: kientzle >>> Date: Sun Apr 14 19:13:51 2013 >>> New Revision: 249484 >>> URL: http://svnweb.freebsd.org/changeset/base/249484 >>> >>> Log: >>> Install a symlink >>>/usr/lib/include ==> /usr/include >>> >>> This fixes -print-file-name=include in clang (and is >>> arguably a better way to fix the same issue in GCC than >>> the change I made in r231336). >>> >>> MFC after: 1 week >>> >>> Modified: >>> head/lib/Makefile >>> >>> Modified: head/lib/Makefile >>> == >>> --- head/lib/MakefileSun Apr 14 18:36:30 2013(r249483) >>> +++ head/lib/MakefileSun Apr 14 19:13:51 2013(r249484) >>> @@ -252,4 +252,7 @@ _libusbhid= libusbhid >>> _libusb= libusb >>> .endif >>> >>> +afterinstall: >>> +ln -fs ../include ${DESTDIR}/usr/lib/include >>> + >>> .include >> >> This breaks with -DNO_CLEAN defined, because then >> ${DESTDIR}/usr/lib/include/include is created. > > That's a good point. Would this work better? > > afterinstall: > if [ ! -e $(DESTDIR)/usr/lib/include ]; then > ln -fs ../include $(DESTDIR)/usr/lib/include > fi > >> I'm not that fond of this patch by the way, but I don't fully >> understand the problem it's trying to solve so I won't object. >> It just looks too much like a hack to me > > It's a subtle issue and I'm not surprised that it raised some > eyebrows. I spent a long time looking for a better solution. > > In short, both GCC and Clang make some assumptions > about the layout of headers used for freestanding compiles. > (My earlier commit said these assumptions were "undocumented", > but that's not quite true, they're just rather obscure.) If you're doing a freestanding compile...shouldn't you also be specifying both include and library paths explicitly? I just feel more confused by this explanation. Why not just specify -I/usr/include? (Or even better, if you're doing a freestanding compile, but want the default include paths, get the compiler to dump the default include paths and process that.) /usr/lib/include is just badly and plainly wrong unless it's absolutely, absolutely necessary. > This symlink is the simplest way I've found to reconcile those > assumptions with the FreeBSD directory layout. I'm happy to > consider alternatives. > > Tim > ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r249484 - head/lib
On Tue, Apr 16, 2013 at 11:26 PM, Tim Kientzle wrote: > > On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote: >> If you're doing a freestanding compile...shouldn't you also be >> specifying both include and library paths explicitly? > > Yes, of course. But the correct directories to use vary somewhat > across platforms, so we would like to have some reasonably > portable way to find the right directory to use for building on > a particular system. > > Both gcc and clang support a -print-file-name=include option which > is supposed to print out the directory containing headers used > for freestanding compiles. You can then take that path and > use it as the explicit include directory path for freestanding builds. Right... >> (Or even better, if you're doing a freestanding >> compile, but want the default include paths, get the compiler to dump >> the default include paths and process that.) > > That's precisely what this is for. I've been working with U-Boot > sources which compile on many systems and use > -print-file-name=include to identify the directory containing > the basic freestanding header files. > > The -print-file-name=include option works on Linux, works > on MacOS, and --- with this one symlink --- can work on > FreeBSD as well. I've been using it to cross-build U-Boot > using the FreeBSD xdev toolchain with both GCC and Clang. I'm confused as to how it wasn't working, and am not convinced that it shouldn't be fixed otherwise. It seems like for clang the user ought to get /usr/include/clang/{version}, except for the problem that we don't put some headers there that some software might expect; so maybe we should just install copies of things like stddef.h into the compiler-specific directory as well? I'm not sure I'm fully understanding your needs, or what you're seeing in practice. Certainly none of those systems have a /usr/lib/include AFAIK; this seems like we're just not deploying our compilers configured in the way that some software (perhaps rightly) expects. And -print-file-name=include doesn't give you the full search path; shouldn't it just give the compiler-specific include directory? You really want something like: % clang -E -Xpreprocessor -v -x c /dev/null For C, and -x c++ for C++. What are the headers you are expecting to find? stddef.h, stdbool.h, stdarg.h? I think I'd rather just see those installed in the compiler-specific dirs, and if we're not spitting those out with our stock-built compilers, we should fix that to match behaviour on other systems. Other systems' -print-file-name=include doesn't expose all of /usr/include, as far as I can tell. That seem excessive and wrong for a freestanding build. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r249790 - in head/sys/mips: include mips
On Tue, Apr 23, 2013 at 2:38 AM, Warner Losh wrote: > Modified: head/sys/mips/include/frame.h > == > --- head/sys/mips/include/frame.h Tue Apr 23 06:37:50 2013 > (r249789) > +++ head/sys/mips/include/frame.h Tue Apr 23 09:38:18 2013 > (r249790) > @@ -37,6 +37,8 @@ > #ifndef _MACHINE_FRAME_H_ > #define_MACHINE_FRAME_H_ > > +/* Note: This must also match regnum.h and regdef.h */ > + > struct trapframe { > register_t zero; > register_t ast; > @@ -46,6 +48,16 @@ struct trapframe { > register_t a1; > register_t a2; > register_t a3; > +#if defined(__mips_n32) || defined(__mips_n64) > + register_t a4; > + register_t a5; > + register_t a6; > + register_t a7; > + register_t t0; > + register_t t1; > + register_t t2; > + register_t t3; > +#else > register_t t0; > register_t t1; > register_t t2; > @@ -54,6 +66,7 @@ struct trapframe { > register_t t5; > register_t t6; > register_t t7; > +#endif > register_t s0; > register_t s1; > register_t s2; > > Modified: head/sys/mips/mips/trap.c > == > --- head/sys/mips/mips/trap.c Tue Apr 23 06:37:50 2013(r249789) > +++ head/sys/mips/mips/trap.c Tue Apr 23 09:38:18 2013(r249790) > @@ -363,10 +363,10 @@ cpu_fetch_syscall_args(struct thread *td > /* > * Non-o32 ABIs support more arguments in registers. > */ > - sa->args[3] = locr0->t4; > - sa->args[4] = locr0->t5; > - sa->args[5] = locr0->t6; > - sa->args[6] = locr0->t7; > + sa->args[3] = locr0->t0; > + sa->args[4] = locr0->t1; > + sa->args[5] = locr0->t2; > + sa->args[6] = locr0->t3; > nsaved += 4; > #ifdef COMPAT_FREEBSD32 > } > @@ -389,10 +389,10 @@ cpu_fetch_syscall_args(struct thread *td > /* > * Non-o32 ABIs support more arguments in registers. > */ > - sa->args[4] = locr0->t4; > - sa->args[5] = locr0->t5; > - sa->args[6] = locr0->t6; > - sa->args[7] = locr0->t7; > + sa->args[4] = locr0->t0; > + sa->args[5] = locr0->t1; > + sa->args[6] = locr0->t2; > + sa->args[7] = locr0->t3; > nsaved += 4; > #ifdef COMPAT_FREEBSD32 > } These should use a4, a5, a6, a7 now, not t0, t1, t2, t3. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r249790 - in head/sys/mips: include mips
Also: the comment says that the trapframe layout must match regnum.h — I don't think that's really true. Why can't we just store things in the trapframe in whatever order we want? Why do they need to match the register numbers. More worrying, however, is that looking at regnum.h brought to my attention the fact that Juniper filed the original license off of the file, and placed a copyright without a license. The same file seems to have been published by SGI under a proprietary/unpublished copyright and under the GPL for Linux, but it's not clear to me that there's a public domain copy that it would have been acceptable for Juniper to assert sole copyright over. It's also definitely unacceptable that Juniper didn't provide a license for that file. I don't see why we shouldn't just replace regnum.h with the NetBSD version, and merge that to all active branches. Since you're trying to update these headers, Warner, it would be great if you could do that. I wish the project had never accepted any code for the MIPS port from Juniper, given their penchant (like OpenBSD's MIPS port — what is it about MIPS ports?) for filing licenses off and placing on their own (or in Juniper's case, none at all.) That's just not acceptable for an open-source project. Juli. On Tue, Apr 23, 2013 at 2:38 AM, Warner Losh wrote: > Author: imp > Date: Tue Apr 23 09:38:18 2013 > New Revision: 249790 > URL: http://svnweb.freebsd.org/changeset/base/249790 > > Log: > Update trapframe to be consistent with the changes made to regnum.h. This > should fix the booting problems people have been seeing. > > Modified: > head/sys/mips/include/frame.h > head/sys/mips/include/regnum.h > head/sys/mips/mips/db_interface.c > head/sys/mips/mips/trap.c > head/sys/mips/mips/vm_machdep.c > > Modified: head/sys/mips/include/frame.h > == > --- head/sys/mips/include/frame.h Tue Apr 23 06:37:50 2013 > (r249789) > +++ head/sys/mips/include/frame.h Tue Apr 23 09:38:18 2013 > (r249790) > @@ -37,6 +37,8 @@ > #ifndef _MACHINE_FRAME_H_ > #define_MACHINE_FRAME_H_ > > +/* Note: This must also match regnum.h and regdef.h */ > + > struct trapframe { > register_t zero; > register_t ast; > @@ -46,6 +48,16 @@ struct trapframe { > register_t a1; > register_t a2; > register_t a3; > +#if defined(__mips_n32) || defined(__mips_n64) > + register_t a4; > + register_t a5; > + register_t a6; > + register_t a7; > + register_t t0; > + register_t t1; > + register_t t2; > + register_t t3; > +#else > register_t t0; > register_t t1; > register_t t2; > @@ -54,6 +66,7 @@ struct trapframe { > register_t t5; > register_t t6; > register_t t7; > +#endif > register_t s0; > register_t s1; > register_t s2; > > Modified: head/sys/mips/include/regnum.h > == > --- head/sys/mips/include/regnum.h Tue Apr 23 06:37:50 2013 > (r249789) > +++ head/sys/mips/include/regnum.h Tue Apr 23 09:38:18 2013 > (r249790) > @@ -87,10 +87,10 @@ > #defineT1 9 > #defineT2 10 > #defineT3 11 > -#defineTA0 12 > -#defineTA1 13 > -#defineTA2 14 > -#defineTA3 15 > +#defineT4 12 > +#defineT5 13 > +#defineT6 14 > +#defineT7 15 > #endif > #defineS0 16 > #defineS1 17 > > Modified: head/sys/mips/mips/db_interface.c > == > --- head/sys/mips/mips/db_interface.c Tue Apr 23 06:37:50 2013 > (r249789) > +++ head/sys/mips/mips/db_interface.c Tue Apr 23 09:38:18 2013 > (r249790) > @@ -77,6 +77,16 @@ struct db_variable db_regs[] = { > { "a1", DB_OFFSET(a1), db_frame }, > { "a2", DB_OFFSET(a2), db_frame }, > { "a3", DB_OFFSET(a3), db_frame }, > +#if defined(__mips_n32) || defined(__mips_n64) > + { "a4", DB_OFFSET(a4), db_frame }, > + { "a5", DB_OFFSET(a5), db_frame }, > + { "a6", DB_OFFSET(a6), db_frame }, > + { "a7", DB_OFFSET(a7), db_frame }, > + { "t0", DB_OFFSET(t0), db_frame }, > + { "t1", DB_OFFSET(t1), db_frame }, > + { "t2", DB_OFFSET(t2), db_frame }, > + { "t3", DB_OFFSET(t3), db_frame }, > +#else > { "t0", DB_OFFSET(t0), db_frame }, > { "t1", DB_OFFSET(t1), db_frame }, > { "t2", DB_OFFSET(t2), db_frame }, > @@ -85,6 +95,7 @@ struct db_variable db_re
Re: svn commit: r254286 - head/sys/fs/ext2fs
On Wed, Aug 14, 2013 at 12:11 AM, Dimitry Andric wrote: > This still fails on arches where int64_t is aliased to long long > (basically, the 32-bit arches). Since using PRId64 is apparently > frowned upon, the easiest solution is to cast the 'start' and 'last' > variables to long long, and print them using %lld. > That can't be the easiest solution, it's not even that easy :) It seems like intmax_t or uintmax_t as appropriate and cast to %jd or %ju respectively would be better. Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r254419 - head/contrib/bmake
On Fri, Aug 16, 2013 at 11:47 AM, Simon J. Gerraty wrote: > Author: sjg > Date: Fri Aug 16 18:47:18 2013 > New Revision: 254419 > URL: http://svnweb.freebsd.org/changeset/base/254419 > > Log: > Add .MAKE.ALWAYS_PASS_JOB_QUEUE knob (default yes) > for backwards compatability. > Thanks very much. Do you have some sense of when/if this might switch to a default of "no"? If so, it seems like it might be good to note that dependence on that behaviour is deprecated and will be removed in 11.0-RELEASE or whenever you think appropriate. Thanks again, Juli. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r250134 - head/sys/mips/include
Warner, May I ask why you're bringing in the 4.4BSD version and not the NetBSD version, which already contained the appropriate ABI gunk? Do we really need to duplicate their work improving the file since 4.4BSD? Thanks, Juli. On Tue, Apr 30, 2013 at 10:46 PM, Warner Losh wrote: > Author: imp > Date: Wed May 1 05:46:54 2013 > New Revision: 250134 > URL: http://svnweb.freebsd.org/changeset/base/250134 > > Log: > Import virgin regdef.h from 4.4 Lite 2's sys/pmax/include/regdef.h, > expand the %sccs.include.redist.c% directive with the standard > 3-clause license, and add $FreeBSD$ to keep the commit script happy. > > # This may break some mips stuff, which will be fixed in the next commit. > > Modified: > head/sys/mips/include/regdef.h > > Modified: head/sys/mips/include/regdef.h > == > --- head/sys/mips/include/regdef.h Wed May 1 05:14:59 2013 > (r250133) > +++ head/sys/mips/include/regdef.h Wed May 1 05:46:54 2013 > (r250134) > @@ -1,86 +1,67 @@ > -/*- > - * Copyright (c) 2001, Juniper Networks, Inc. > - * All rights reserved. > - * Truman Joe, February 2001. > +/* > + * Copyright (c) 1992, 1993 > + * The Regents of the University of California. All rights reserved. > * > - * regdef.h -- MIPS register definitions. > + * This code is derived from software contributed to Berkeley by > + * Ralph Campbell. This file is derived from the MIPS RISC > + * Architecture book by Gerry Kane. > * > - * JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta > - * $FreeBSD$ > - */ > - > -#ifndef _MACHINE_REGDEF_H_ > -#define_MACHINE_REGDEF_H_ > - > -#include /* For API selection */ > - > -#if defined(__ASSEMBLER__) > -/* General purpose CPU register names */ > -#definezero$0 /* wired zero */ > -#defineAT $at /* assembler temp */ > -#definev0 $2 /* return value */ > -#definev1 $3 > -#definea0 $4 /* argument registers */ > -#definea1 $5 > -#definea2 $6 > -#definea3 $7 > -#if defined(__mips_n32) || defined(__mips_n64) > -#definea4 $8 > -#definea5 $9 > -#definea6 $10 > -#definea7 $11 > -#definet0 $12 /* Temp regs, not saved accross subroutine > calls */ > -#definet1 $13 > -#definet2 $14 > -#definet3 $15 > -#else > -#definet0 $8 /* caller saved */ > -#definet1 $9 > -#definet2 $10 > -#definet3 $11 > -#definet4 $12 /* caller saved - 32 bit env arg reg 64 bit */ > -#definet5 $13 > -#definet6 $14 > -#definet7 $15 > -#endif > -#defines0 $16 /* callee saved */ > -#defines1 $17 > -#defines2 $18 > -#defines3 $19 > -#defines4 $20 > -#defines5 $21 > -#defines6 $22 > -#defines7 $23 > -#definet8 $24 /* code generator */ > -#definet9 $25 > -#definek0 $26 /* kernel temporary */ > -#definek1 $27 > -#definegp $28 /* global pointer */ > -#definesp $29 /* stack pointer */ > -#definefp $30 /* frame pointer */ > -#defines8 $30 /* callee saved */ > -#definera $31 /* return address */ > - > -/* > - * These are temp registers whose names can be used in either the old > - * or new ABI, although they map to different physical registers. In > - * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + *notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *notice, this list of conditions and the following disclaimer in the > + *documentation and/or other materials provided with the distribution. > + * 4. Neither the name of the University nor the names of its contributors > + *may be used to endorse or promote products derived from this software > + *without specific prior written permission. > * > - * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 > - * should be used only when we need more than t0-t3. > + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, I
Re: svn commit: r250426 - head/sys/contrib/octeon-sdk
On Thu, May 9, 2013 at 7:57 PM, Warner Losh wrote: > Log: > Both my EBH5200 and GE WANIC 6354 have a RTC as well. It looks from > the Linux tree that they always include this chip in their FDT, so > make support for the ds1337 opt-out rather than opt-in. Now my boards > boot with the correct time. What boards did you test on without RTCs to verify that it doesn't cause hangs? The fact that there are two boards not enumerated which did have an RTC doesn't say anything about the boards that truly don't. Likewise, Linux's FDT is not authoritative for all boards. I'd feel better knowing this at least won't have a negative effect on boards without an RTC. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r250431 - head/usr.bin/xargs
Eitan, Are other changes coming to xargs for which these style changes make sense? If not, I'd say that style changes which only adjust vertical whitespace, especially those which mostly add vertical whitespace at the start of functions with no local variables (which is one of the most archaic and unusual things style(9) requires), are probably the most gratuitous and silly style changes to make. That doesn't even rise to being a style change, it's just a whitespace change. And I really do believe that vertical whitespace changes are much, much sillier than horizontal whitespace changes. Curious what the motivation was here; was xargs the only utility in usr.bin which didn't conform to style(9) in this regard? (No.) Was this part of a tree-wide sweep to finally bring conformity to these rules? (I hope not.) What's the point?* Juli. *: Not that I've never made changes equally-gratuitous; I certainly have, and so would more strongly discourage people from making them given the regret and embarrassment I feel about having done so with the aid of years of hindsight, and a greater awareness of how easy it is to make minor functional improvements, or at least do refactoring with some purpose in mind, if one just wants to leave one's thumbprint. (Watch for standalone commits from people who used to be very active developers who have recently hit the threshold for getting commit bit reaper E-Mails. They're fairly instructive in the art of making occasional insignificant changes for the sake of making changes.) On Thu, May 9, 2013 at 8:49 PM, Eitan Adler wrote: > Author: eadler > Date: Fri May 10 03:49:05 2013 > New Revision: 250431 > URL: http://svnweb.freebsd.org/changeset/base/250431 > > Log: > Style(9) changes fo xargs.c > > Modified: > head/usr.bin/xargs/xargs.c > > Modified: head/usr.bin/xargs/xargs.c > == > --- head/usr.bin/xargs/xargs.c Fri May 10 03:42:48 2013(r250430) > +++ head/usr.bin/xargs/xargs.c Fri May 10 03:49:05 2013(r250431) > @@ -670,12 +670,14 @@ pids_init(void) > static int > pids_empty(void) > { > + > return (curprocs == 0); > } > > static int > pids_full(void) > { > + > return (curprocs >= maxprocs); > } > > @@ -709,7 +711,6 @@ findfreeslot(void) > > if ((slot = findslot(NOPID)) < 0) > errx(1, "internal error: no free pid slot"); > - > return (slot); > } > > @@ -721,13 +722,13 @@ findslot(pid_t pid) > for (slot = 0; slot < maxprocs; slot++) > if (childpids[slot] == pid) > return (slot); > - > return (-1); > } > > static void > clearslot(int slot) > { > + > childpids[slot] = NOPID; > } > > @@ -762,6 +763,7 @@ prompt(void) > static void > usage(void) > { > + > fprintf(stderr, > "usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S > replsize]]\n" > " [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]\n" ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r250940 - head/sys/mips/mips
Thanks very much, Marcel, and everyone involved at Juniper! On Thu, May 23, 2013 at 12:47 PM, Marcel Moolenaar wrote: > Author: marcel > Date: Thu May 23 19:47:37 2013 > New Revision: 250940 > URL: http://svnweb.freebsd.org/changeset/base/250940 > > Log: > Change the copyright notice to a standard BSD 2-clause license and assign > ownership to the FreeBSD foundation for the years this file has been in > the FreeBSD repository. > > This file was originally created by Juniper as part of upgrading to FreeBSD > 4.10 (which had no MIPS support) and held functions found on other machines > It grew actual functionality over time. The functionaliy was copied from > other architectures and ported to MIPS on a as-needed basis. > > Approved by: Mark Baushke (Juniper IP) > Approved by: Megan Sugiyama (Juniper legal) > Pointed out by: jmallett@ > Requested by: core (jhb@) > > Modified: > head/sys/mips/mips/db_trace.c > > Modified: head/sys/mips/mips/db_trace.c > == > --- head/sys/mips/mips/db_trace.c Thu May 23 19:47:35 2013 > (r250939) > +++ head/sys/mips/mips/db_trace.c Thu May 23 19:47:37 2013 > (r250940) > @@ -1,7 +1,29 @@ > /*- > + * Copyright (c) 2008-2013 The FreeBSD Foundation > * Copyright (c) 2004-2005, Juniper Networks, Inc. > * All rights reserved. > * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + *notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *notice, this list of conditions and the following disclaimer in the > + *documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > * JNPR: db_trace.c,v 1.8 2007/08/09 11:23:32 katta > */ > ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"