Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp661268rdb; Wed, 17 Jan 2024 13:23:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IExUvrz0FVPoaLZ8LrfohYaVRbh5RfaN4Lxu4YbEu+ZtmdkBpWo3v2Hcpd0LiZj5B4+PJG/ X-Received: by 2002:a67:b44b:0:b0:469:8c4d:d861 with SMTP id c11-20020a67b44b000000b004698c4dd861mr123711vsm.28.1705526630117; Wed, 17 Jan 2024 13:23:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705526630; cv=pass; d=google.com; s=arc-20160816; b=xOkWnwKudEjy3P3bBHUhCuiXr5TWLeW2tgRudU9B1qTsRv9raQmUTRosI/UT5LH1cb VmL12WoPVufWVsBPP7MPtZI2MwlYOvfdFEyZ23i0J0XRncDg3KWrJOh0/RG3XrQRohMA aJIuQpQLhC+hMDHge4+bgUqjTGMXe2oVYpyO8NHWCu+tjCh0adEh+T3fI/2jTpTLZdCY xoxAx4we10GLdGvFa3ONKC6C32oWWpAu9e+FxY0u16FTJ9J1qyHX+h4FCVuD2agOH04h wGO5gPTR/s18tgkqlUzlnxzhrJav4+zhFrzvvIdf64xi948Bix5q0TbO14vFyJAeCkqm DnjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=nk4PnGFoII20WorTY8XPDUyENB4Rwy8FvWCgKEj2dRQ=; fh=U2kClSAq92jkh6OYLnBKbL4v/RnggTOFAVGp/J9mjCk=; b=CK9GiUK20YmXAFkukBRUR8vX0z9ixI4kNj/IfVlUg0dQpwsZA0G1yEofY+vuc9YjIz YUPQGxUQ6wLecIYfeZmJmSzNHsems/iOZbi1rCHhH7TSMjsqXTRouhz7slo+Y1VxD5nU bJtRMd/sFaNKSxAUdN8OaGLRHQTBgCsrNapRM4DZe4UevsSszVlhr00ny+l9g8bex1jZ 2GNX/Z05BcRBNsFJi8tPUT/yTpZ4IZEWoj8tJBH7mcSKXR2ntq398R2mPpsegVXi6Me1 dDkYNQzH65tgzg5PT9mLVfRnKStoCeC/MwhUtYSmGoxX6dTjq70xK7mrv7w1NibCafOM MuOg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PJkoipQW; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-29460-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29460-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x9-20020a0ce249000000b00681884950eesi675274qvl.233.2024.01.17.13.23.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 13:23:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29460-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PJkoipQW; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-29460-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29460-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DB1A01C24C1C for ; Wed, 17 Jan 2024 21:23:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA5002868D; Wed, 17 Jan 2024 21:23:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PJkoipQW" Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46B5725572 for ; Wed, 17 Jan 2024 21:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705526608; cv=none; b=J0In3r9fmmPKfn3DksZi1/VMd+uvxK5fB2/t3FYaFOx6qedZIUKHKXgYUqS7kOc4aAQjLtL455P5LgdHO4JKPN92/hN5zN6hqGgPNCEo3rhZiUEYkKt9ApbMYMm8EW8Qip9yq6yxjKN41Byl1Kj5HbMLx3VoDsW91FuedgUjiPE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705526608; c=relaxed/simple; bh=kaH9a9Hkr2U67UKTfEUbe2RJ6wXoXhdTorzk0Et6RZU=; h=Message-ID:DKIM-Signature:Date:MIME-Version:Subject: Content-Language:To:Cc:References:X-Report-Abuse:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-Migadu-Flow; b=ZLFQ5getovPVir4xUdQHpfINOa+ClLKn7L5aGjSEt/GuqvaiRC1lX9HQzJFSeCOcFCMf+kAOrob7GuTYISzggzXTJaswo+YlKi1JjDgmImrQ8G5PuWVZJVPFCpbPgyz/lJJ/W+1a9roWgDeFwUqnf8kFrvFwdTUemtroNZtPv+E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=PJkoipQW; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <8a6c5297-6e86-4f0d-a85e-1a93b2215d68@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1705526604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nk4PnGFoII20WorTY8XPDUyENB4Rwy8FvWCgKEj2dRQ=; b=PJkoipQWE81phR1YEm2bC199QlluF2n9wF8zN9x+YvsVDQktC/Q3hZe9S5CFC2H58mS1wP O8O1vhvjSwAvfOIyRgKu+JCG1Bvd4AeGioh6nssHPmEXfkLr3OgwyH6fSk1+ixw+kVKdpZ r+1hjmg5xsS9FayjZhG7AKbbHz0pQpU= Date: Wed, 17 Jan 2024 21:23:20 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v5] ptp: ocp: add Adva timecard support Content-Language: en-US To: Sagi Maimon , richardcochran@gmail.com, jonathan.lemon@gmail.com, vadfed@fb.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kuba@kernel.org References: <20240117114350.3105-1-maimon.sagi@gmail.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20240117114350.3105-1-maimon.sagi@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 17/01/2024 11:43, Sagi Maimon wrote: > Adding support for the Adva timecard. > The card uses different drivers to provide access to the > firmware SPI flash (Altera based). > Other parts of the code are the same and could be reused. > Hi Sagi, Thanks for adjusting the code. One signle still have to be adjusted, see comments below. And this is treated as net-next material, but net-next is closed now until merge window ends, you will have to submit new version next week. Please, also use '[PATCH net-next v6] ...' prefix for it. > Signed-off-by: Sagi Maimon > --- > Changes since version 4: > - alignment fix. > Please, preserve changes from all previous versions for next submissions. > drivers/ptp/ptp_ocp.c | 302 ++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 293 insertions(+), 9 deletions(-) > [ ..skip.. ] > @@ -2603,7 +2819,44 @@ ptp_ocp_art_board_init(struct ptp_ocp *bp, struct ocp_resource *r) > if (err) > return err; > > - return ptp_ocp_init_clock(bp); > + return ptp_ocp_init_clock(bp, r->extra); > +} > + > +/* ADVA specific board initializers; last "resource" registered. */ > +static int > +ptp_ocp_adva_board_init(struct ptp_ocp *bp, struct ocp_resource *r) > +{ > + int err; > + u32 version; > + > + bp->flash_start = 0xA00000; > + bp->eeprom_map = fb_eeprom_map; > + bp->sma_op = &ocp_adva_sma_op; > + > + version = ioread32(&bp->image->version); > + /* if lower 16 bits are empty, this is the fw loader. */ > + if ((version & 0xffff) == 0) { > + version = version >> 16; > + bp->fw_loader = true; > + } > + bp->fw_tag = 1; Please, use fw_tag = 3 here, other tags are for other vendors. Thanks, Vadim > + bp->fw_version = version & 0xffff; > + bp->fw_cap = OCP_CAP_BASIC | OCP_CAP_SIGNAL | OCP_CAP_FREQ; > + > + ptp_ocp_tod_init(bp); > + ptp_ocp_nmea_out_init(bp); > + ptp_ocp_signal_init(bp); > +