greybus: svc: clean up CPortFlags handling
authorJohan Hovold <johan@hovoldconsulting.com>
Thu, 3 Mar 2016 12:34:37 +0000 (13:34 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 5 Mar 2016 02:26:08 +0000 (18:26 -0800)
Clean up CPortFlags handling and explicitly disable CSD when E2EFC is
enabled (CSD_n is ignored when E2EFC is set).

Note that the bootrom requires E2EFC, CSD, and CSV to all be disabled.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/svc.c

index eeb251e2844113c5474032380a67213872be3466..65c6d8ee1c51d85c85f0d4c7c3f8a5b2e2e01ee5 100644 (file)
@@ -291,21 +291,14 @@ int gb_svc_connection_create(struct gb_svc *svc,
        request.cport1_id = cpu_to_le16(cport1_id);
        request.intf2_id = intf2_id;
        request.cport2_id = cpu_to_le16(cport2_id);
-       /*
-        * XXX: fix connections paramaters to TC0 and all CPort flags
-        * for now.
-        */
-       request.tc = 0;
+       request.tc = 0;         /* TC0 */
 
-       /*
-        * We need to skip setting E2EFC and other flags to the connection
-        * create request, for all cports, on an interface that need to boot
-        * over unipro, i.e. interfaces required to download firmware.
-        */
+       /* The ES2/ES3 bootrom requires E2EFC, CSD and CSV to be disabled. */
+       request.flags = CPORT_FLAGS_CSV_N;
        if (boot_over_unipro)
-               request.flags = CPORT_FLAGS_CSV_N | CPORT_FLAGS_CSD_N;
+               request.flags |= CPORT_FLAGS_CSD_N;
        else
-               request.flags = CPORT_FLAGS_CSV_N | CPORT_FLAGS_E2EFC;
+               request.flags |= CPORT_FLAGS_CSD_N | CPORT_FLAGS_E2EFC;
 
        return gb_operation_sync(svc->connection, GB_SVC_TYPE_CONN_CREATE,
                                 &request, sizeof(request), NULL, 0);