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 <mst@semihalf.com>
Obtained from:	Semihalf
Sponsored by:	Stormshield
Differential revision:	https://reviews.freebsd.org/D6220
This commit is contained in:
zbb 2016-06-02 18:41:33 +00:00
parent 03c47d2a4c
commit 44920da28c
4 changed files with 45 additions and 1 deletions

View File

@ -81,6 +81,11 @@ device iic
device iicbus
device twsi
# CESA
device cesa
device crypto
device cryptodev
#FDT
options FDT
options FDT_DTB_STATIC

View File

@ -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>;

View File

@ -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>;

View File

@ -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;
}