diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2016-02-29 03:38:00 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2016-02-29 03:38:00 +0000 |
commit | 8bf1194fe59ab6a4905efd0ff00cd6b7462247e1 (patch) | |
tree | 5b00ae419405b400d27fe05a3ed4868b17bbcb84 /sys/powerpc | |
parent | 52a73c87240c0127dc9cc5990eb4c701f34efdd2 (diff) | |
download | FreeBSD-src-8bf1194fe59ab6a4905efd0ff00cd6b7462247e1.zip FreeBSD-src-8bf1194fe59ab6a4905efd0ff00cd6b7462247e1.tar.gz |
Add support for the Freescale dTSEC DPAA-based ethernet controller.
Freescale's QorIQ line includes a new ethernet controller, based on their
Datapath Acceleration Architecture (DPAA). This uses a combination of a Frame
manager, Buffer manager, and Queue manager to improve performance across all
interfaces by being able to pass data directly between hardware acceleration
interfaces.
As part of this import, Freescale's Netcomm Software (ncsw) driver is imported.
This was an attempt by Freescale to create an OS-agnostic sub-driver for
managing the hardware, using shims to interface to the OS-specific APIs. This
work was abandoned, and Freescale's primary work is in the Linux driver (dual
BSD/GPL license). Hence, this was imported directly to sys/contrib, rather than
going through the vendor area. Going forward, FreeBSD-specific changes may be
made to the ncsw code, diverging from the upstream in potentially incompatible
ways. An alternative could be to import the Linux driver itself, using the
linuxKPI layer, as that would maintain parity with the vendor-maintained driver.
However, the Linux driver has not been evaluated for reliability yet, and may
have issues with the import, whereas the ncsw-based driver in this commit was
completed by Semihalf 4 years ago, and is very stable.
Other SoC modules based on DPAA, which could be added in the future:
* Security and Encryption engine (SEC4.x, SEC5.x)
* RAID engine
Additional work to be done:
* Implement polling mode
* Test vlan support
* Add support for the Pattern Matching Engine, which can do regular expression
matching on packets.
This driver has been tested on the P5020 QorIQ SoC. Others listed in the
dtsec(4) manual page are expected to work as the same DPAA engine is included in
all.
Obtained from: Semihalf
Relnotes: Yes
Sponsored by: Alex Perez/Inertial Computing
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/booke/pmap.c | 3 | ||||
-rw-r--r-- | sys/powerpc/conf/dpaa/DPAA | 101 | ||||
-rw-r--r-- | sys/powerpc/conf/dpaa/config.dpaa | 21 | ||||
-rw-r--r-- | sys/powerpc/conf/dpaa/config.p2041 | 11 | ||||
-rw-r--r-- | sys/powerpc/conf/dpaa/config.p3041 | 11 | ||||
-rw-r--r-- | sys/powerpc/conf/dpaa/config.p5020 | 11 | ||||
-rw-r--r-- | sys/powerpc/conf/dpaa/files.dpaa | 105 | ||||
-rw-r--r-- | sys/powerpc/conf/dpaa/files.p2041 | 3 | ||||
-rw-r--r-- | sys/powerpc/conf/dpaa/files.p3041 | 3 | ||||
-rw-r--r-- | sys/powerpc/conf/dpaa/files.p5020 | 3 | ||||
-rw-r--r-- | sys/powerpc/include/intr_machdep.h | 3 | ||||
-rw-r--r-- | sys/powerpc/include/tlb.h | 5 | ||||
-rw-r--r-- | sys/powerpc/powerpc/intr_machdep.c | 24 |
13 files changed, 298 insertions, 6 deletions
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 2b883b8..54f215a 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -198,7 +198,6 @@ static void tid_flush(tlbtid_t tid); static void tlb_print_entry(int, uint32_t, uint32_t, uint32_t, uint32_t); -static int tlb1_set_entry(vm_offset_t, vm_paddr_t, vm_size_t, uint32_t); static void tlb1_write_entry(unsigned int); static int tlb1_iomapped(int, vm_paddr_t, vm_size_t, vm_offset_t *); static vm_size_t tlb1_mapin_region(vm_offset_t, vm_paddr_t, vm_size_t); @@ -3203,7 +3202,7 @@ size2tsize(vm_size_t size) * Entries are created starting from index 0 (current free entry is * kept in tlb1_idx) and are not supposed to be invalidated. */ -static int +int tlb1_set_entry(vm_offset_t va, vm_paddr_t pa, vm_size_t size, uint32_t flags) { diff --git a/sys/powerpc/conf/dpaa/DPAA b/sys/powerpc/conf/dpaa/DPAA new file mode 100644 index 0000000..e5c7e9e --- /dev/null +++ b/sys/powerpc/conf/dpaa/DPAA @@ -0,0 +1,101 @@ +# +# Common kernel config for Freescale QorIQ DPAA development boards like the +# P2041RDB, P3041DS and P5020DS. +# +# This is not standalone kernel config. Use it only for including +# purposes. +# +# $FreeBSD$ + +cpu BOOKE +cpu BOOKE_E500 + +machine powerpc powerpc +#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" +makeoptions NO_MODULES=yes + +# Platform support +options QORIQ_DPAA #Freescale SoC family + +options SMP #Symmetric Multi Processing + +#options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options NFSCL #New Network Filesystem Client +options SOFTUPDATES #Enable FFS soft updates support +options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +options GEOM_PART_GPT #GUID Partition Tables. +options GEOM_LABEL +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options NO_SWAPPING + +options KDB #Enable the kernel debugger +options DDB #Support DDB +options GDB + +options ALT_BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER +options DIAGNOSTIC +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS + +options KTR +options KTR_COMPILE=0xffffffff +options KTR_MASK=KTR_PMAP +options KTR_ENTRIES=8192 + +options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_KDB + +# RamFS Root +#options GEOM_UZIP +#options MD_ROOT +#options MD_ROOT_SIZE=10240 + +# Netbooting +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=dtsec3 +options NFS_ROOT + +# Block devices +device mmc +device mmcsd +device sdhci + +# Network devices +device miibus # MII bus support +device em + + +# I2C support +device iicbus +device iic + +device uart +device ehci +device usb +device scbus +device da +device umass +device pty +device cfi + +device pci + +# Pseudo devices +device ether # Ethernet support +device loop # Network loopback +device random # Entropy device +device bpf # Berkeley packet filter +device md # Memory "disks" + diff --git a/sys/powerpc/conf/dpaa/config.dpaa b/sys/powerpc/conf/dpaa/config.dpaa new file mode 100644 index 0000000..bc68498 --- /dev/null +++ b/sys/powerpc/conf/dpaa/config.dpaa @@ -0,0 +1,21 @@ +# $FreeBSD$ + +makeoptions DPAA_COMPILE_CMD_COMMON="${NORMAL_C} \ + -Wno-cast-qual -Wno-unused-function -Wno-init-self -fms-extensions \ + -include $S/contrib/ncsw/build/dflags.h \ + -I$S/contrib/ncsw/build/ \ + -I$S/contrib/ncsw/inc \ + -I$S/contrib/ncsw/inc/cores \ + -I$S/contrib/ncsw/inc/etc \ + -I$S/contrib/ncsw/inc/Peripherals \ + -I$S/contrib/ncsw/etc \ + -I$S/contrib/ncsw/Peripherals/BM \ + -I$S/contrib/ncsw/Peripherals/FM \ + -I$S/contrib/ncsw/Peripherals/FM/HC \ + -I$S/contrib/ncsw/Peripherals/FM/inc \ + -I$S/contrib/ncsw/Peripherals/FM/MAC \ + -I$S/contrib/ncsw/Peripherals/FM/Pcd \ + -I$S/contrib/ncsw/Peripherals/FM/Port \ + -I$S/contrib/ncsw/Peripherals/FM/Rtc \ + -I$S/contrib/ncsw/Peripherals/QM \ + -I$S/contrib/ncsw/inc/integrations" diff --git a/sys/powerpc/conf/dpaa/config.p2041 b/sys/powerpc/conf/dpaa/config.p2041 new file mode 100644 index 0000000..4e7bec1 --- /dev/null +++ b/sys/powerpc/conf/dpaa/config.p2041 @@ -0,0 +1,11 @@ +# $FreeBSD$ + +files "dpaa/files.dpaa" +files "dpaa/files.p2041" + +include "dpaa/config.dpaa" + +makeoptions DPAA_COMPILE_CMD="${DPAA_COMPILE_CMD_COMMON} \ + -I$S/contrib/ncsw/inc/integrations/P2041" + +device dpaa diff --git a/sys/powerpc/conf/dpaa/config.p3041 b/sys/powerpc/conf/dpaa/config.p3041 new file mode 100644 index 0000000..9334de6 --- /dev/null +++ b/sys/powerpc/conf/dpaa/config.p3041 @@ -0,0 +1,11 @@ +# $FreeBSD$ + +files "dpaa/files.dpaa" +files "dpaa/files.p3041" + +include "dpaa/config.dpaa" + +makeoptions DPAA_COMPILE_CMD="${DPAA_COMPILE_CMD_COMMON} \ + -I$S/contrib/ncsw/inc/integrations/P3041" + +device dpaa diff --git a/sys/powerpc/conf/dpaa/config.p5020 b/sys/powerpc/conf/dpaa/config.p5020 new file mode 100644 index 0000000..28eaeba --- /dev/null +++ b/sys/powerpc/conf/dpaa/config.p5020 @@ -0,0 +1,11 @@ +# $FreeBSD$ + +files "dpaa/files.dpaa" +files "dpaa/files.p5020" + +include "dpaa/config.dpaa" + +makeoptions DPAA_COMPILE_CMD="${DPAA_COMPILE_CMD_COMMON} \ + -I$S/contrib/ncsw/inc/integrations/P5020" + +device dpaa diff --git a/sys/powerpc/conf/dpaa/files.dpaa b/sys/powerpc/conf/dpaa/files.dpaa new file mode 100644 index 0000000..2975838 --- /dev/null +++ b/sys/powerpc/conf/dpaa/files.dpaa @@ -0,0 +1,105 @@ +# $FreeBSD$ + +# NetCommSw drivers +contrib/ncsw/etc/error.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/etc/list.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/etc/memcpy.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/etc/mm.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/etc/ncsw_mem.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/etc/sprint.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/BM/bm.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/BM/bman_low.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/BM/bm_pool.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/BM/bm_portal.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/Rtc/fm_rtc.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/Port/fm_port.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/Port/fm_port_im.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/Pcd/fm_cc.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/Pcd/fm_kg.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/Pcd/fm_manip.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/Pcd/fm_pcd.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/Pcd/fm_plcr.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/Pcd/fm_prs.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/MAC/dtsec.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/MAC/dtsec_mii_acc.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/MAC/fm_mac.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/MAC/tgec.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/MAC/tgec_mii_acc.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/HC/hc.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/fm_muram.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/fm_guest.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/FM/fm.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/QM/qm.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/Peripherals/QM/qm_portal_fqr.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/user/env/stdlib.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/user/env/xx.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +contrib/ncsw/user/env/core.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" + +# FreeBSD Wrappers +dev/dpaa/dpaa.c optional dpaa fdt \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/portals_common.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/bman_portals.c optional dpaa fdt \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/bman.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/bman_fdt.c optional dpaa fdt \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/qman_portals.c optional dpaa fdt \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/qman.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/qman_fdt.c optional dpaa fdt \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/fman.c optional dpaa fdt \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/fman_fdt.c optional dpaa fdt \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/if_dtsec.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/if_dtsec_im.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/if_dtsec_rm.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/if_dtsec_fdt.c optional dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" + +# Examples +dev/dpaa/bman-example.c optional bman_example dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" +dev/dpaa/qman-example.c optional qman_example dpaa \ + no-depend compile-with "${DPAA_COMPILE_CMD}" diff --git a/sys/powerpc/conf/dpaa/files.p2041 b/sys/powerpc/conf/dpaa/files.p2041 new file mode 100644 index 0000000..dfb4afc --- /dev/null +++ b/sys/powerpc/conf/dpaa/files.p2041 @@ -0,0 +1,3 @@ +# $FreeBSD$ + +contrib/ncsw/integrations/P2041/module_strings.c optional dpaa diff --git a/sys/powerpc/conf/dpaa/files.p3041 b/sys/powerpc/conf/dpaa/files.p3041 new file mode 100644 index 0000000..89bb35c --- /dev/null +++ b/sys/powerpc/conf/dpaa/files.p3041 @@ -0,0 +1,3 @@ +# $FreeBSD$ + +contrib/ncsw/integrations/P3041/module_strings.c optional dpaa diff --git a/sys/powerpc/conf/dpaa/files.p5020 b/sys/powerpc/conf/dpaa/files.p5020 new file mode 100644 index 0000000..b442d2e --- /dev/null +++ b/sys/powerpc/conf/dpaa/files.p5020 @@ -0,0 +1,3 @@ +# $FreeBSD$ + +contrib/ncsw/integrations/P5020/module_strings.c optional dpaa diff --git a/sys/powerpc/include/intr_machdep.h b/sys/powerpc/include/intr_machdep.h index 32a94be..5fbf9ee 100644 --- a/sys/powerpc/include/intr_machdep.h +++ b/sys/powerpc/include/intr_machdep.h @@ -58,4 +58,7 @@ int powerpc_bind_intr(u_int irq, u_char cpu); int powerpc_config_intr(int, enum intr_trigger, enum intr_polarity); int powerpc_fw_config_intr(int irq, int sense_code); +void powerpc_intr_mask(u_int irq); +void powerpc_intr_unmask(u_int irq); + #endif /* _MACHINE_INTR_MACHDEP_H_ */ diff --git a/sys/powerpc/include/tlb.h b/sys/powerpc/include/tlb.h index 8fb7c85..65293bf 100644 --- a/sys/powerpc/include/tlb.h +++ b/sys/powerpc/include/tlb.h @@ -121,11 +121,7 @@ #define KERNEL_REGION_MAX_TLB_ENTRIES 4 #define _TLB_ENTRY_IO (MAS2_I | MAS2_G) -#ifdef SMP #define _TLB_ENTRY_MEM (MAS2_M) -#else -#define _TLB_ENTRY_MEM (0) -#endif #if !defined(LOCORE) typedef struct tlb_entry { @@ -215,6 +211,7 @@ struct pmap; void tlb_lock(uint32_t *); void tlb_unlock(uint32_t *); +int tlb1_set_entry(vm_offset_t, vm_paddr_t, vm_size_t, uint32_t); #endif /* !LOCORE */ diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c index a17d9ff..74dc4f5 100644 --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -615,3 +615,27 @@ stray: if (i != NULL) PIC_MASK(i->pic, i->intline); } + +void +powerpc_intr_mask(u_int irq) +{ + struct powerpc_intr *i; + + i = intr_lookup(irq); + if (i == NULL || i->pic == NULL) + return; + + PIC_MASK(i->pic, i->intline); +} + +void +powerpc_intr_unmask(u_int irq) +{ + struct powerpc_intr *i; + + i = intr_lookup(irq); + if (i == NULL || i->pic == NULL) + return; + + PIC_UNMASK(i->pic, i->intline); +} |