From owner-svn-src-head@freebsd.org Sat Nov 12 20:45:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B0C8C3D2CA; Sat, 12 Nov 2016 20:45:06 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C42AA199A; Sat, 12 Nov 2016 20:45:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uACKj5Bt011163; Sat, 12 Nov 2016 20:45:05 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uACKj3Sk011148; Sat, 12 Nov 2016 20:45:03 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201611122045.uACKj3Sk011148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 12 Nov 2016 20:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308584 - in head/sys: boot/fdt/dts/powerpc dev/dpaa powerpc/conf/dpaa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 20:45:06 -0000 Author: jhibbits Date: Sat Nov 12 20:45:03 2016 New Revision: 308584 URL: https://svnweb.freebsd.org/changeset/base/308584 Log: Make dpaa work with only slightly modified Linux device trees. Linux has a slightly different device tree definition for DPAA than originally done in the FreeBSD driver. This changes the driver to be mostly compatible with the Linux device tree definitions. Currently the differences are: bman-portals: compatible = "fsl,bman-portals" (Linux is "simple-bus") qman-portals: compatible = "fsl,qman-portals" (Linux is "simple-bus") fman: compatible = "fsl,fman" (Linux is "simple-bus") The Linux device tree doesn't specify anything for rgmii in the mdio. This change still requires the device tree to specify the phy-handle, and doesn't yet support tbi. Deleted: head/sys/dev/dpaa/dpaa.c Modified: head/sys/boot/fdt/dts/powerpc/p2041rdb.dts head/sys/boot/fdt/dts/powerpc/p2041si.dtsi head/sys/boot/fdt/dts/powerpc/p3041ds.dts head/sys/boot/fdt/dts/powerpc/p3041si.dtsi head/sys/boot/fdt/dts/powerpc/p5020ds.dts head/sys/boot/fdt/dts/powerpc/p5020si.dtsi head/sys/dev/dpaa/bman_fdt.c head/sys/dev/dpaa/fman.c head/sys/dev/dpaa/fman.h head/sys/dev/dpaa/if_dtsec.c head/sys/dev/dpaa/if_dtsec_fdt.c head/sys/dev/dpaa/if_dtsec_rm.c head/sys/dev/dpaa/qman_fdt.c head/sys/powerpc/conf/dpaa/files.dpaa Modified: head/sys/boot/fdt/dts/powerpc/p2041rdb.dts ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p2041rdb.dts Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p2041rdb.dts Sat Nov 12 20:45:03 2016 (r308584) @@ -442,47 +442,6 @@ }; }; - fsl,dpaa { - compatible = "fsl,p2041-dpaa", "fsl,dpaa"; - - ethernet@0 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet0>; - status = "okay"; - }; - ethernet@1 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet1>; - status = "okay"; - }; - ethernet@2 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet2>; - status = "okay"; - }; - ethernet@3 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet3>; - status = "okay"; - }; - ethernet@4 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet4>; - status = "okay"; - }; - ethernet@5 { - compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet5>; - status = "okay"; - }; - }; - chosen { stdin = "serial0"; stdout = "serial0"; Modified: head/sys/boot/fdt/dts/powerpc/p2041si.dtsi ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p2041si.dtsi Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p2041si.dtsi Sat Nov 12 20:45:03 2016 (r308584) @@ -208,7 +208,7 @@ bman-portals@ff4000000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "bman-portals"; + compatible = "fsl,bman-portals"; ranges = <0x0 0xf 0xfde00000 0x200000>; bman-portal@0 { cell-index = <0x0>; @@ -281,7 +281,7 @@ qman-portals@ff4200000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "qman-portals"; + compatible = "fsl,qman-portals"; ranges = <0x0 0xf 0xfdc00000 0x200000>; qportal0: qman-portal@0 { cell-index = <0x0>; @@ -913,8 +913,8 @@ pme: pme@316000 { compatible = "fsl,pme"; reg = <0x316000 0x10000>; - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + /* "fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* "fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ interrupts = <16 2 1 5>; }; @@ -923,16 +923,16 @@ reg = <0x318000 0x1000>; interrupts = <16 2 1 3>; /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + /* "fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* "fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ }; bman: bman@31a000 { compatible = "fsl,p2041-bman", "fsl,bman"; reg = <0x31a000 0x1000>; interrupts = <16 2 1 2>; - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + /* Same as "fsl,qman-*, use default allocation */ + /* "fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ }; fman0: fman@400000 { @@ -983,27 +983,27 @@ fman0_rx0: port@88000 { cell-index = <0>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x88000 0x1000>; }; fman0_rx1: port@89000 { cell-index = <1>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x89000 0x1000>; }; fman0_rx2: port@8a000 { cell-index = <2>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8a000 0x1000>; }; fman0_rx3: port@8b000 { cell-index = <3>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8b000 0x1000>; }; fman0_rx4: port@8c000 { cell-index = <4>; - compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p2041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8c000 0x1000>; }; fman0_rx5: port@90000 { @@ -1020,31 +1020,31 @@ }; fman0_tx0: port@a8000 { cell-index = <0>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa8000 0x1000>; fsl,qman-channel-id = <0x41>; }; fman0_tx1: port@a9000 { cell-index = <1>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa9000 0x1000>; fsl,qman-channel-id = <0x42>; }; fman0_tx2: port@aa000 { cell-index = <2>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xaa000 0x1000>; fsl,qman-channel-id = <0x43>; }; fman0_tx3: port@ab000 { cell-index = <3>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xab000 0x1000>; fsl,qman-channel-id = <0x44>; }; fman0_tx4: port@ac000 { cell-index = <4>; - compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p2041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xac000 0x1000>; fsl,qman-channel-id = <0x45>; }; @@ -1093,7 +1093,7 @@ enet0: ethernet@e0000 { cell-index = <0>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe0000 0x1000>; fsl,port-handles = <&fman0_rx0 &fman0_tx0>; }; @@ -1108,7 +1108,7 @@ enet1: ethernet@e2000 { cell-index = <1>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe2000 0x1000>; fsl,port-handles = <&fman0_rx1 &fman0_tx1>; }; @@ -1123,7 +1123,7 @@ enet2: ethernet@e4000 { cell-index = <2>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe4000 0x1000>; fsl,port-handles = <&fman0_rx2 &fman0_tx2>; }; @@ -1138,7 +1138,7 @@ enet3: ethernet@e6000 { cell-index = <3>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe6000 0x1000>; fsl,port-handles = <&fman0_rx3 &fman0_tx3>; }; @@ -1153,7 +1153,7 @@ enet4: ethernet@e8000 { cell-index = <4>; - compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p2041-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe8000 0x1000>; fsl,port-handles = <&fman0_rx4 &fman0_tx4>; }; @@ -1168,7 +1168,7 @@ enet5: ethernet@f0000 { cell-index = <0>; - compatible = "fsl,p2041-fman-10g-mac", "fsl,fman-10g-mac"; + compatible = "fsl,p2041-fman-10g-mac", "fsl,fman-10g-mac", "fsl,fman-xgec"; reg = <0xf0000 0x1000>; fsl,port-handles = <&fman0_rx5 &fman0_tx5>; }; Modified: head/sys/boot/fdt/dts/powerpc/p3041ds.dts ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p3041ds.dts Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p3041ds.dts Sat Nov 12 20:45:03 2016 (r308584) @@ -539,47 +539,6 @@ }; }; - fsl,dpaa { - compatible = "fsl,p3041-dpaa", "fsl,dpaa"; - - ethernet@0 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet0>; - status="okay"; - }; - ethernet@1 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet1>; - status = "disabled"; - }; - ethernet@2 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet2>; - status = "disabled"; - }; - ethernet@3 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet3>; - status = "disabled"; - }; - ethernet@4 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet4>; - status = "okay"; - }; - ethernet@5 { - compatible = "fsl,p3041-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet5>; - status = "disabled"; - }; - }; - chosen { stdin = "serial0"; stdout = "serial0"; Modified: head/sys/boot/fdt/dts/powerpc/p3041si.dtsi ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p3041si.dtsi Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p3041si.dtsi Sat Nov 12 20:45:03 2016 (r308584) @@ -209,7 +209,7 @@ bman-portals@ff4000000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "bman-portals"; + compatible = "fsl,bman-portals"; ranges = <0x0 0xf 0xfde00000 0x200000>; bman-portal@0 { cell-index = <0x0>; @@ -282,7 +282,7 @@ qman-portals@ff4200000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "qman-portals"; + compatible = "fsl,qman-portals"; ranges = <0x0 0xf 0xfdc00000 0x200000>; qportal0: qman-portal@0 { cell-index = <0x0>; @@ -915,8 +915,8 @@ pme: pme@316000 { compatible = "fsl,pme"; reg = <0x316000 0x10000>; - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + /* "fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* "fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ interrupts = <16 2 1 5>; }; @@ -925,16 +925,16 @@ reg = <0x318000 0x1000>; interrupts = <16 2 1 3>; /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + /* "fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* "fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ }; bman: bman@31a000 { compatible = "fsl,p3041-bman", "fsl,bman"; reg = <0x31a000 0x1000>; interrupts = <16 2 1 2>; - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + /* Same as "fsl,qman-*, use default allocation */ + /* "fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ }; fman0: fman@400000 { @@ -985,27 +985,27 @@ fman0_rx0: port@88000 { cell-index = <0>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x88000 0x1000>; }; fman0_rx1: port@89000 { cell-index = <1>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x89000 0x1000>; }; fman0_rx2: port@8a000 { cell-index = <2>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8a000 0x1000>; }; fman0_rx3: port@8b000 { cell-index = <3>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8b000 0x1000>; }; fman0_rx4: port@8c000 { cell-index = <4>; - compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p3041-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8c000 0x1000>; }; fman0_rx5: port@90000 { @@ -1022,31 +1022,31 @@ }; fman0_tx0: port@a8000 { cell-index = <0>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa8000 0x1000>; fsl,qman-channel-id = <0x41>; }; fman0_tx1: port@a9000 { cell-index = <1>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa9000 0x1000>; fsl,qman-channel-id = <0x42>; }; fman0_tx2: port@aa000 { cell-index = <2>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xaa000 0x1000>; fsl,qman-channel-id = <0x43>; }; fman0_tx3: port@ab000 { cell-index = <3>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xab000 0x1000>; fsl,qman-channel-id = <0x44>; }; fman0_tx4: port@ac000 { cell-index = <4>; - compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p3041-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xac000 0x1000>; fsl,qman-channel-id = <0x45>; }; @@ -1095,7 +1095,8 @@ enet0: ethernet@e0000 { cell-index = <0>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe0000 0x1000>; fsl,port-handles = <&fman0_rx0 &fman0_tx0>; ptimer-handle = <&ptp_timer0>; @@ -1111,7 +1112,8 @@ enet1: ethernet@e2000 { cell-index = <1>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe2000 0x1000>; fsl,port-handles = <&fman0_rx1 &fman0_tx1>; ptimer-handle = <&ptp_timer0>; @@ -1127,7 +1129,8 @@ enet2: ethernet@e4000 { cell-index = <2>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe4000 0x1000>; fsl,port-handles = <&fman0_rx2 &fman0_tx2>; ptimer-handle = <&ptp_timer0>; @@ -1143,7 +1146,8 @@ enet3: ethernet@e6000 { cell-index = <3>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe6000 0x1000>; fsl,port-handles = <&fman0_rx3 &fman0_tx3>; }; @@ -1158,7 +1162,8 @@ enet4: ethernet@e8000 { cell-index = <4>; - compatible = "fsl,p3041-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p3041-fman-1g-mac", + "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe8000 0x1000>; fsl,port-handles = <&fman0_rx4 &fman0_tx4>; ptimer-handle = <&ptp_timer0>; @@ -1174,7 +1179,8 @@ enet5: ethernet@f0000 { cell-index = <0>; - compatible = "fsl,p3041-fman-10g-mac", "fsl,fman-10g-mac"; + compatible = "fsl,p3041-fman-10g-mac", + "fsl,fman-10g-mac", "fsl,fman-xgec"; reg = <0xf0000 0x1000>; fsl,port-handles = <&fman0_rx5 &fman0_tx5>; }; Modified: head/sys/boot/fdt/dts/powerpc/p5020ds.dts ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p5020ds.dts Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p5020ds.dts Sat Nov 12 20:45:03 2016 (r308584) @@ -535,47 +535,6 @@ }; }; - fsl,dpaa { - compatible = "fsl,p5020-dpaa", "fsl,dpaa"; - - ethernet@0 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet0>; - status = "okay"; - }; - ethernet@1 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet1>; - status = "disabled"; - }; - ethernet@2 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet2>; - status = "disabled"; - }; - ethernet@3 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet3>; - status = "disabled"; - }; - ethernet@4 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet4>; - status = "okay"; - }; - ethernet@5 { - compatible = "fsl,p5020-dpa-ethernet", "fsl,dpa-ethernet"; - fsl,qman-channel = <&qpool1>; - fsl,fman-mac = <&enet5>; - status = "disabled"; - }; - }; - chosen { stdin = "serial0"; stdout = "serial0"; Modified: head/sys/boot/fdt/dts/powerpc/p5020si.dtsi ============================================================================== --- head/sys/boot/fdt/dts/powerpc/p5020si.dtsi Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/boot/fdt/dts/powerpc/p5020si.dtsi Sat Nov 12 20:45:03 2016 (r308584) @@ -194,7 +194,7 @@ bman-portals@ff4000000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "bman-portals"; + compatible = "fsl,bman-portals"; ranges = <0x0 0xf 0xfde00000 0x200000>; bman-portal@0 { cell-index = <0x0>; @@ -267,7 +267,7 @@ qman-portals@ff4200000 { #address-cells = <0x1>; #size-cells = <0x1>; - compatible = "qman-portals"; + compatible = "fsl,qman-portals"; ranges = <0x0 0xf 0xfdc00000 0x200000>; qportal0: qman-portal@0 { cell-index = <0x0>; @@ -960,8 +960,8 @@ pme: pme@316000 { compatible = "fsl,pme"; reg = <0x316000 0x10000>; - /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ - /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + /* "fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* "fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ interrupts = <16 2 1 5>; }; @@ -970,16 +970,16 @@ reg = <0x318000 0x1000>; interrupts = <16 2 1 3>; /* Commented out, use default allocation */ - /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ - /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + /* "fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* "fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ }; bman: bman@31a000 { compatible = "fsl,p5020-bman", "fsl,bman"; reg = <0x31a000 0x1000>; interrupts = <16 2 1 2>; - /* Same as fsl,qman-*, use default allocation */ - /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + /* Same as "fsl,qman-*, use default allocation */ + /* "fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ }; fman0: fman@400000 { @@ -1030,27 +1030,27 @@ fman0_rx0: port@88000 { cell-index = <0>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x88000 0x1000>; }; fman0_rx1: port@89000 { cell-index = <1>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x89000 0x1000>; }; fman0_rx2: port@8a000 { cell-index = <2>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8a000 0x1000>; }; fman0_rx3: port@8b000 { cell-index = <3>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8b000 0x1000>; }; fman0_rx4: port@8c000 { cell-index = <4>; - compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx"; + compatible = "fsl,p5020-fman-port-1g-rx", "fsl,fman-port-1g-rx", "fsl,fman-v2-port-rx"; reg = <0x8c000 0x1000>; }; fman0_rx5: port@90000 { @@ -1067,31 +1067,31 @@ }; fman0_tx0: port@a8000 { cell-index = <0>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa8000 0x1000>; fsl,qman-channel-id = <0x41>; }; fman0_tx1: port@a9000 { cell-index = <1>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xa9000 0x1000>; fsl,qman-channel-id = <0x42>; }; fman0_tx2: port@aa000 { cell-index = <2>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xaa000 0x1000>; fsl,qman-channel-id = <0x43>; }; fman0_tx3: port@ab000 { cell-index = <3>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xab000 0x1000>; fsl,qman-channel-id = <0x44>; }; fman0_tx4: port@ac000 { cell-index = <4>; - compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx"; + compatible = "fsl,p5020-fman-port-1g-tx", "fsl,fman-port-1g-tx", "fsl,fman-v2-port-tx"; reg = <0xac000 0x1000>; fsl,qman-channel-id = <0x45>; }; @@ -1140,7 +1140,7 @@ enet0: ethernet@e0000 { cell-index = <0>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe0000 0x1000>; fsl,port-handles = <&fman0_rx0 &fman0_tx0>; ptimer-handle = <&ptp_timer0>; @@ -1156,7 +1156,7 @@ enet1: ethernet@e2000 { cell-index = <1>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe2000 0x1000>; fsl,port-handles = <&fman0_rx1 &fman0_tx1>; ptimer-handle = <&ptp_timer0>; @@ -1172,7 +1172,7 @@ enet2: ethernet@e4000 { cell-index = <2>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe4000 0x1000>; fsl,port-handles = <&fman0_rx2 &fman0_tx2>; ptimer-handle = <&ptp_timer0>; @@ -1188,7 +1188,7 @@ enet3: ethernet@e6000 { cell-index = <3>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe6000 0x1000>; fsl,port-handles = <&fman0_rx3 &fman0_tx3>; ptimer-handle = <&ptp_timer0>; @@ -1204,7 +1204,7 @@ enet4: ethernet@e8000 { cell-index = <4>; - compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac"; + compatible = "fsl,p5020-fman-1g-mac", "fsl,fman-1g-mac", "fsl,fman-dtsec"; reg = <0xe8000 0x1000>; fsl,port-handles = <&fman0_rx4 &fman0_tx4>; ptimer-handle = <&ptp_timer0>; @@ -1220,7 +1220,7 @@ enet5: ethernet@f0000 { cell-index = <0>; - compatible = "fsl,p5020-fman-10g-mac", "fsl,fman-10g-mac"; + compatible = "fsl,p5020-fman-10g-mac", "fsl,fman-10g-mac", "fsl,fman-xgec"; reg = <0xf0000 0x1000>; fsl,port-handles = <&fman0_rx5 &fman0_tx5>; }; Modified: head/sys/dev/dpaa/bman_fdt.c ============================================================================== --- head/sys/dev/dpaa/bman_fdt.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/bman_fdt.c Sat Nov 12 20:45:03 2016 (r308584) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -105,7 +106,8 @@ static driver_t bm_portals_driver = { }; static devclass_t bm_portals_devclass; -DRIVER_MODULE(bman_portals, ofwbus, bm_portals_driver, bm_portals_devclass, 0, 0); +EARLY_DRIVER_MODULE(bman_portals, ofwbus, bm_portals_driver, + bm_portals_devclass, 0, 0, BUS_PASS_BUS); static void get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep) @@ -121,7 +123,7 @@ static int bman_portals_fdt_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "bman-portals")) + if (!ofw_bus_is_compatible(dev, "fsl,bman-portals")) return (ENXIO); device_set_desc(dev, BMAN_PORT_DEVSTR); @@ -129,6 +131,25 @@ bman_portals_fdt_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static phandle_t +bman_portal_find_cpu(int cpu) +{ + phandle_t node; + pcell_t reg; + + node = OF_finddevice("/cpus"); + if (node == -1) + return (node); + + for (node = OF_child(node); node != 0; node = OF_peer(node)) { + if (OF_getprop(node, "reg", ®, sizeof(reg)) <= 0) + continue; + if (reg == cpu) + return (node); + } + return (-1); +} + static int bman_portals_fdt_attach(device_t dev) { @@ -152,13 +173,17 @@ bman_portals_fdt_attach(device_t dev) /* Find portals tied to CPUs */ for (child = OF_child(node); child != 0; child = OF_peer(child)) { + if (cpus >= mp_ncpus) + break; if (!ofw_bus_node_is_compatible(child, "fsl,bman-portal")) { continue; } /* Checkout related cpu */ if (OF_getprop(child, "cpu-handle", (void *)&cpu, sizeof(cpu)) <= 0) { - continue; + cpu = bman_portal_find_cpu(cpus); + if (cpu <= 0) + continue; } /* Acquire cpu number */ cpu_node = OF_instance_to_package(cpu); @@ -169,9 +194,6 @@ bman_portals_fdt_attach(device_t dev) cpus++; - if (cpus > MAXCPU) - break; - if (ofw_bus_gen_setup_devinfo(&ofw_di, child) != 0) { device_printf(dev, "could not set up devinfo\n"); continue; Modified: head/sys/dev/dpaa/fman.c ============================================================================== --- head/sys/dev/dpaa/fman.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/fman.c Sat Nov 12 20:45:03 2016 (r308584) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -50,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include "fman.h" +static MALLOC_DEFINE(M_FMAN, "fman", "fman devices information"); + /** * @group FMan private defines. * @{ @@ -259,6 +260,8 @@ fman_attach(device_t dev) { struct fman_softc *sc; struct fman_config cfg; + pcell_t qchan_range[2]; + phandle_t node; sc = device_get_softc(dev); sc->sc_base.dev = dev; @@ -272,6 +275,14 @@ fman_attach(device_t dev) XX_TrackInit(); + node = ofw_bus_get_node(dev); + if (OF_getencprop(node, "fsl,qman-channel-range", qchan_range, + sizeof(qchan_range)) <= 0) { + device_printf(dev, "Missing QMan channel range property!\n"); + return (ENXIO); + } + sc->qman_chan_base = qchan_range[0]; + sc->qman_chan_count = qchan_range[1]; sc->mem_rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, RF_ACTIVE | RF_SHAREABLE); @@ -379,4 +390,21 @@ fman_shutdown(device_t dev) return (0); } +int +fman_qman_channel_id(device_t dev, int port) +{ + struct fman_softc *sc; + int qman_port_id[] = {0x31, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, + 0x2f, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->qman_chan_count; i++) { + if (qman_port_id[i] == port) + return (sc->qman_chan_base + i); + } + + return (0); +} + /** @} */ Modified: head/sys/dev/dpaa/fman.h ============================================================================== --- head/sys/dev/dpaa/fman.h Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/fman.h Sat Nov 12 20:45:03 2016 (r308584) @@ -42,6 +42,8 @@ struct fman_softc { int mem_rid; int irq_rid; int err_irq_rid; + int qman_chan_base; + int qman_chan_count; t_Handle fm_handle; t_Handle muram_handle; @@ -59,6 +61,7 @@ int fman_resume(device_t dev); int fman_shutdown(device_t dev); int fman_read_ivar(device_t dev, device_t child, int index, uintptr_t *result); +int fman_qman_channel_id(device_t, int); /** @} */ uint32_t fman_get_clock(struct fman_softc *sc); Modified: head/sys/dev/dpaa/if_dtsec.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/if_dtsec.c Sat Nov 12 20:45:03 2016 (r308584) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/sys/dev/dpaa/if_dtsec_fdt.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_fdt.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/if_dtsec_fdt.c Sat Nov 12 20:45:03 2016 (r308584) @@ -87,7 +87,7 @@ static driver_t dtsec_driver = { }; static devclass_t dtsec_devclass; -DRIVER_MODULE(dtsec, dpaa, dtsec_driver, dtsec_devclass, 0, 0); +DRIVER_MODULE(dtsec, fman, dtsec_driver, dtsec_devclass, 0, 0); DRIVER_MODULE(miibus, dtsec, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(dtsec, ether, 1, 1, 1); MODULE_DEPEND(dtsec, miibus, 1, 1, 1); @@ -96,7 +96,8 @@ static int dtsec_fdt_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "fsl,dpa-ethernet")) + if (!ofw_bus_is_compatible(dev, "fsl,fman-dtsec") && + !ofw_bus_is_compatible(dev, "fsl,fman-xgec")) return (ENXIO); device_set_desc(dev, "Freescale Data Path Triple Speed Ethernet " @@ -119,9 +120,7 @@ find_mdio(phandle_t phy_node, device_t m if (phy_node <= 0) return (ENOENT); - if (fman_get_dev(&bus) < 0) - return (ENOENT); - + bus = device_get_parent(mac); *mdio_dev = ofw_bus_find_child_device_by_phandle(bus, phy_node); return (0); @@ -131,21 +130,13 @@ static int dtsec_fdt_attach(device_t dev) { struct dtsec_softc *sc; - phandle_t node, enet_node, phy_node; + phandle_t enet_node, phy_node; phandle_t fman_rxtx_node[2]; char phy_type[6]; + pcell_t fman_tx_cell; sc = device_get_softc(dev); - node = ofw_bus_get_node(dev); - - if (OF_getprop(node, "fsl,fman-mac", (void *)&enet_node, - sizeof(enet_node)) == -1) { - device_printf(dev, "Could not load fsl,fman-mac property " - "from DTS\n"); - return (ENXIO); - } - - enet_node = OF_instance_to_package(enet_node); + enet_node = ofw_bus_get_node(dev); if (OF_getprop(enet_node, "local-mac-address", (void *)sc->sc_mac_addr, 6) == -1) { @@ -155,9 +146,9 @@ dtsec_fdt_attach(device_t dev) } /* Get link speed */ - if (ofw_bus_node_is_compatible(enet_node, "fsl,fman-1g-mac") != 0) + if (ofw_bus_is_compatible(dev, "fsl,fman-dtsec") != 0) sc->sc_eth_dev_type = ETH_DTSEC; - else if (ofw_bus_node_is_compatible(enet_node, "fsl,fman-10g-mac") != 0) + else if (ofw_bus_is_compatible(dev, "fsl,fman-xgec") != 0) sc->sc_eth_dev_type = ETH_10GSEC; else return(ENXIO); @@ -197,7 +188,7 @@ dtsec_fdt_attach(device_t dev) return (ENXIO); /* Get RX/TX port handles */ - if (OF_getprop(enet_node, "fsl,port-handles", (void *)fman_rxtx_node, + if (OF_getprop(enet_node, "fsl,fman-ports", (void *)fman_rxtx_node, sizeof(fman_rxtx_node)) <= 0) return (ENXIO); @@ -211,11 +202,11 @@ dtsec_fdt_attach(device_t dev) fman_rxtx_node[1] = OF_instance_to_package(fman_rxtx_node[1]); if (ofw_bus_node_is_compatible(fman_rxtx_node[0], - "fsl,fman-port-1g-rx") == 0) + "fsl,fman-v2-port-rx") == 0) return (ENXIO); if (ofw_bus_node_is_compatible(fman_rxtx_node[1], - "fsl,fman-port-1g-tx") == 0) + "fsl,fman-v2-port-tx") == 0) return (ENXIO); /* Get RX port HW id */ @@ -228,11 +219,12 @@ dtsec_fdt_attach(device_t dev) sizeof(sc->sc_port_tx_hw_id)) <= 0) return (ENXIO); - /* Get QMan channel */ - if (OF_getprop(fman_rxtx_node[1], "fsl,qman-channel-id", - (void *)&sc->sc_port_tx_qman_chan, - sizeof(sc->sc_port_tx_qman_chan)) <= 0) + if (OF_getprop(fman_rxtx_node[1], "cell-index", &fman_tx_cell, + sizeof(fman_tx_cell)) <= 0) return (ENXIO); + /* Get QMan channel */ + sc->sc_port_tx_qman_chan = fman_qman_channel_id(device_get_parent(dev), + fman_tx_cell); return (dtsec_attach(dev)); } Modified: head/sys/dev/dpaa/if_dtsec_rm.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_rm.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/if_dtsec_rm.c Sat Nov 12 20:45:03 2016 (r308584) @@ -323,6 +323,7 @@ dtsec_rm_pool_rx_init(struct dtsec_softc DTSEC_RM_POOL_RX_HIGH_MARK, 0, 0, dtsec_rm_pool_rx_depleted, sc, NULL, NULL); if (sc->sc_rx_pool == NULL) { + device_printf(sc->sc_dev, "NULL rx pool somehow\n"); dtsec_rm_pool_rx_free(sc); return (EIO); } Modified: head/sys/dev/dpaa/qman_fdt.c ============================================================================== --- head/sys/dev/dpaa/qman_fdt.c Sat Nov 12 19:45:55 2016 (r308583) +++ head/sys/dev/dpaa/qman_fdt.c Sat Nov 12 20:45:03 2016 (r308584) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -105,7 +106,8 @@ static driver_t qm_portals_driver = { }; static devclass_t qm_portals_devclass; -DRIVER_MODULE(qman_portals, ofwbus, qm_portals_driver, qm_portals_devclass, 0, 0); +EARLY_DRIVER_MODULE(qman_portals, ofwbus, qm_portals_driver, + qm_portals_devclass, 0, 0, BUS_PASS_BUS); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***