MIPS: Octeon: Configure XAUI pkinds
authorJanne Huttunen <[email protected]>
Thu, 13 Aug 2015 13:21:36 +0000 (16:21 +0300)
committerRalf Baechle <[email protected]>
Thu, 3 Sep 2015 10:08:09 +0000 (12:08 +0200)
Configure the pkinds of XAUI interfaces on Octeon models that have
them. This simple configuration uses 1:1 mapping between the PIP input
port number and the selected pkind.

Signed-off-by: Janne Huttunen <[email protected]>
Signed-off-by: Aaro Koskinen <[email protected]>
Acked-by: David Daney <[email protected]>
Cc: David Daney <[email protected]>
Cc: [email protected]
Cc: Janne Huttunen <[email protected]>
Cc: Aaro Koskinen <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/10971/
Signed-off-by: Ralf Baechle <[email protected]>
arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c

index 323a784f70711e921f75cc6fff06049788439e99..a56ee590de1f36b50a4f2f7bc962f01e224bc141 100644 (file)
@@ -124,6 +124,13 @@ int __cvmx_helper_xaui_enable(int interface)
        union cvmx_gmxx_tx_int_en gmx_tx_int_en;
        union cvmx_pcsxx_int_en_reg pcsx_int_en_reg;
 
+       /* Setup PKND */
+       if (octeon_has_feature(OCTEON_FEATURE_PKND)) {
+               gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(0, interface));
+               gmx_cfg.s.pknd = cvmx_helper_get_ipd_port(interface, 0);
+               cvmx_write_csr(CVMX_GMXX_PRTX_CFG(0, interface), gmx_cfg.u64);
+       }
+
        /* (1) Interface has already been enabled. */
 
        /* (2) Disable GMX. */