Author: zbb
Date: Thu Jun  2 18:41:33 2016
New Revision: 301225
URL: https://svnweb.freebsd.org/changeset/base/301225

Log:
  Add support for CESA on Armada38x
  
  Changes:
  - added new SoC ID in CESA attach
  - allowed crypto driver IDs other than 0
  - added CESA nodes to Armada38x .dts files
  - enabled required devices in kernconf
  
  Submitted by: Michal Stanek <m...@semihalf.com>
  Obtained from:        Semihalf
  Sponsored by: Stormshield
  Differential revision:        https://reviews.freebsd.org/D6220

Modified:
  head/sys/arm/conf/ARMADA38X
  head/sys/boot/fdt/dts/arm/armada-388-gp.dts
  head/sys/boot/fdt/dts/arm/armada-38x.dtsi
  head/sys/dev/cesa/cesa.c

Modified: head/sys/arm/conf/ARMADA38X
==============================================================================
--- head/sys/arm/conf/ARMADA38X Thu Jun  2 18:39:33 2016        (r301224)
+++ head/sys/arm/conf/ARMADA38X Thu Jun  2 18:41:33 2016        (r301225)
@@ -81,6 +81,11 @@ device               iic
 device         iicbus
 device         twsi
 
+# CESA
+device         cesa
+device         crypto
+device         cryptodev
+
 #FDT
 options        FDT
 options        FDT_DTB_STATIC

Modified: head/sys/boot/fdt/dts/arm/armada-388-gp.dts
==============================================================================
--- head/sys/boot/fdt/dts/arm/armada-388-gp.dts Thu Jun  2 18:39:33 2016        
(r301224)
+++ head/sys/boot/fdt/dts/arm/armada-388-gp.dts Thu Jun  2 18:41:33 2016        
(r301225)
@@ -62,6 +62,13 @@
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
 
                internal-regs {
+                       crypto@90000 {
+                               status = "okay";
+                       };
+                       crypto@92000 {
+                               status = "okay";
+                       };
+
                        spi@10600 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&spi0_pins>;

Modified: head/sys/boot/fdt/dts/arm/armada-38x.dtsi
==============================================================================
--- head/sys/boot/fdt/dts/arm/armada-38x.dtsi   Thu Jun  2 18:39:33 2016        
(r301224)
+++ head/sys/boot/fdt/dts/arm/armada-38x.dtsi   Thu Jun  2 18:41:33 2016        
(r301225)
@@ -63,6 +63,8 @@
                gpio1 = &gpio1;
                serial0 = &uart0;
                serial1 = &uart1;
+               sram0 = &SRAM0;
+               sram1 = &SRAM1;
        };
 
        pmu {
@@ -70,6 +72,16 @@
                interrupts-extended = <&mpic 3>;
        };
 
+       SRAM0: sram@f1100000 {
+               compatible = "mrvl,cesa-sram";
+               reg = <0xf1100000 0x0010000>;
+       };
+
+       SRAM1: sram@f1110000 {
+               compatible = "mrvl,cesa-sram";
+               reg = <0xf1110000 0x0010000>;
+       };
+
        soc {
                compatible = "marvell,armada380-mbus", "simple-bus";
                #address-cells = <2>;
@@ -140,6 +152,25 @@
                        #size-cells = <1>;
                        ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
 
+                       crypto@90000 {
+                               compatible = "mrvl,cesa";
+                               reg = <0x90000 0x10000>;
+                               interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-parent = <&gic>;
+                               sram-handle = <&SRAM0>;
+                               status = "disabled";
+                       };
+
+                       crypto@92000 {
+                               compatible = "mrvl,cesa";
+                               reg = <0x92000 0x1000   /* tdma base reg chan 1 
*/
+                                      0x9F000 0x1000>; /* cesa base reg chan 1 
*/
+                               interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-parent = <&gic>;
+                               sram-handle = <&SRAM1>;
+                               status = "disabled";
+                       };
+
                        L2: cache-controller@8000 {
                                compatible = "arm,pl310-cache";
                                reg = <0x8000 0x1000>;

Modified: head/sys/dev/cesa/cesa.c
==============================================================================
--- head/sys/dev/cesa/cesa.c    Thu Jun  2 18:39:33 2016        (r301224)
+++ head/sys/dev/cesa/cesa.c    Thu Jun  2 18:41:33 2016        (r301225)
@@ -1043,6 +1043,7 @@ cesa_attach(device_t dev)
        switch (d) {
        case MV_DEV_88F6281:
        case MV_DEV_88F6282:
+       case MV_DEV_88F6828:
                sc->sc_tperr = 0;
                break;
        case MV_DEV_MV78100:
@@ -1214,7 +1215,7 @@ cesa_attach(device_t dev)
 
        /* Register in OCF */
        sc->sc_cid = crypto_get_driverid(dev, CRYPTOCAP_F_HARDWARE);
-       if (sc->sc_cid) {
+       if (sc->sc_cid < 0) {
                device_printf(dev, "could not get crypto driver id\n");
                goto err8;
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to