Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1338052rdb; Wed, 24 Jan 2024 11:51:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzVMBlLipVZZ49rhzVhSPDQlF2hJWBKIKG2kmqno6K4Yoqni0nF3hJCKzIKtX2zOUVvsTO X-Received: by 2002:a05:6a00:6c9f:b0:6db:cf61:eacf with SMTP id jc31-20020a056a006c9f00b006dbcf61eacfmr52810pfb.69.1706125904689; Wed, 24 Jan 2024 11:51:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706125904; cv=pass; d=google.com; s=arc-20160816; b=PoosH/jElwENQ2sI+40NYVnSCwffQSxvjsPwaNIg1/rP1hEgs7JTreNkwy7auQJhMc IXdflvOCMeWRvoxIuXs3GkEFPXpDtS3sH5OLZyc1lqPuHIlrwfotec7KTM25g3GIc3wj bHTkJncUGgAMyNu/g+B5ywQB04Z53bl8h9U1+UKXfNqINWatRcVlM2hZ0cTZdypXrApm Y6r0xyLC0El3KJ3F6LxH8cm8KIRdEOkG3tzjIaNAl0zXWlBS26uz5LRxCf2RXv2JuWXE LqxUzWFAm55XlZ3PaHxO4bHxX50fGy7HIuOhDnhWcJRv2zAKVDP96I97D1swxODi+Yc0 KunQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=LbUXpdpBL5inpaz8wpZ3Hd1xvaYHJgSJQFchXab3614=; fh=dVBRHRM/l8pWpnZMoZoQERJPnyZQChVYiXGRSN8ub8E=; b=np2brT6FXeB7W96AIOyh623QeWXrOuQSJAA88XgVnBG0/v/UkpJJ/4oC2CkkVQQu6t ZiFnmUBangjnkE7nq7Wl3h5X0jm1uxpKY6j/V4JgOYoQoV6j/Cu5vd7mbHq+8suIVa50 3j2eRM3IlPkMHPw7qi2dVoY1JK/9zOSsNtuQzVzZUpfEuenRUwCpxSVzogpMU9obG9Lp 2nmoUmebRoREcsosJDfLn/jOZbPfIs5w/L7d/aLRTe8scLhQAbmqKDZTYYOtm1GsUbCU WNJPCPR6lI0XkjPfAGb/gYbCn2dL+CEWYyf1fuqlN/VpD12qPNq9BvQwk706f69baLg4 tkCw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YCcTa0dT; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-37611-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37611-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fc4-20020a056a002e0400b006d45aab6faasi14837430pfb.40.2024.01.24.11.51.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 11:51:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37611-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YCcTa0dT; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-37611-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37611-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4CB512870C5 for ; Wed, 24 Jan 2024 19:51:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D7F7133425; Wed, 24 Jan 2024 19:51:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YCcTa0dT" Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5C9013340C for ; Wed, 24 Jan 2024 19:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706125895; cv=none; b=H6Oy3xPQ01TIowCw4BejcZ4Tb/UzKn2bHNs0LvyStguSbcOEiYnzYm33hJVqVexRtKoB++ITVUhqz0qED9CnM4tKvfTVV4SxqpU5VXaVwj5YEgzAbCcvzin/ZAAqU3Rffh5aNXhXmmsIjMTxyC5NMjVnAX5ZueYbUeo2TBqUMnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706125895; c=relaxed/simple; bh=9RgnrZAMWic/KU6v8vx6qvscwLiT9mhJjXhgg6UxIS0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=F3oAb069jN8ZDuN0ouY+GHPVPk2pUbZV+DfrT/uCTYMwOmro67HSk56RMYc3tgiUhnB6Or5RxFtqoSYcoxqNEaMnmY4S+LPNB93pjvHdU+03hAYrI99kKnfLjtkj57C7YEpzu82F3OlKyYInYaR9o/9K3ZOjienYMryv/Jo1vgA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=YCcTa0dT; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-5cf765355ecso3107683a12.0 for ; Wed, 24 Jan 2024 11:51:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706125893; x=1706730693; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LbUXpdpBL5inpaz8wpZ3Hd1xvaYHJgSJQFchXab3614=; b=YCcTa0dTAvJ/NQncvAxv/uTwTOk/zkXNuCvPY40OLaIrfWxvb7a57P9CaIdqGKv4jx CO+CXpaBBCuR5+7ihG+IE7lk2NfG6SU7ZOU57DTSoebqsj2hCEF5kGQWCBOrjjR1Mxvf MWIpXEs54fSlsr0PRF6nO9iVPC/3ev/Qo2FyR2ulqKQp6SAm3Obgiw+7FohdSfFjEHoQ X0xnAaXWDILC9nGcHMCuuxmXteyvk7fnvo3fCGik7yAYR7L95QOHA7WatREpSue4oFIy DcIuwNkZtoqcZ+RHUBOUOh2aR1+WS85UCj9MokMv/Deqd7T+VkMUZ879d+H0GIjbYe+G UC7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706125893; x=1706730693; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LbUXpdpBL5inpaz8wpZ3Hd1xvaYHJgSJQFchXab3614=; b=t/dfuSTxVG0Jzl//4deGQ4qC2KoUDrvZ2pLG9wKQ4T6zf7ZMgxIf3Ol5FlQwNa/I4P 6D60t7c1DI+k7xivfgFl9Wtae8XK3kccwkhIvfPrM5/LokUMdRou9LcXj399eK+8WsNI sCREzC08wZ0XpL8Ck1b/Kn4Km1c03hfOt56WwAGwnLPdrbxcjzstwSd4PFAFSb2UGGb/ rTsgpnNMy1QkkOJisvyWrN1C2MH06HJuk5/I/HSPB6q9g57J87KkdvSRchKeWdTlm29u fB2Cvp8AJ+o64EW/IGAtub05SDG8sUKa+ksHJSgSAALpONg7Zc5bmfX+U+LFKMrDTSCs RTCA== X-Gm-Message-State: AOJu0Yyv1XkyLqJ9aYWAHqGI0UtF7hYPppX4bA+tFnd1c4wHgsgSgtOH JpLerOnKrwEBSDM0CEgJsF1fns/woc6REVhdHw45Mxmd/ZkdnAuGZXnCGlh6C/uVKmkOLwBl+9v zeI80EiltSTI5BN2/uZsXsiff4XUPKq6g0j1SlQ== X-Received: by 2002:a17:90b:3606:b0:290:c91e:7402 with SMTP id ml6-20020a17090b360600b00290c91e7402mr52093pjb.78.1706125892911; Wed, 24 Jan 2024 11:51:32 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240120012948.8836-1-semen.protsenko@linaro.org> <20240120012948.8836-6-semen.protsenko@linaro.org> <9c9e71ff-42ab-4753-80cf-09b34a97b28c@linaro.org> In-Reply-To: <9c9e71ff-42ab-4753-80cf-09b34a97b28c@linaro.org> From: Sam Protsenko Date: Wed, 24 Jan 2024 13:51:21 -0600 Message-ID: Subject: Re: [PATCH 5/7] spi: s3c64xx: Add Exynos850 support To: Tudor Ambarus Cc: Krzysztof Kozlowski , Andi Shyti , Mark Brown , Rob Herring , Conor Dooley , Alim Akhtar , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 24, 2024 at 12:49=E2=80=AFAM Tudor Ambarus wrote: > > > > On 1/20/24 01:29, Sam Protsenko wrote: > > Add SPI port configuration for Exynos850 SoC. It has 3 USI blocks which > > can be configured in SPI mode: > > > > * spi_0: BLK_PERI_SPI_0 (0x13940000) > > * spi_1: BLK_ALIVE_USI_CMGP00 (0x11d00000) > > * spi_2: BLK_ALIVE_USI_CMGP01 (0x11d20000) > > > > SPI FIFO depth is 64 bytes for all those SPI blocks, so the > > .fifo_lvl_mask value is set to 0x7f. All blocks have DIV_4 as the > > default internal clock divider, and an internal loopback mode to run > > a loopback test. > > > > Signed-off-by: Sam Protsenko > > Reviewed-by: Tudor Ambarus > > > --- > > drivers/spi/spi-s3c64xx.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c > > index 0e48ffd499b9..f7d623ad6ac3 100644 > > --- a/drivers/spi/spi-s3c64xx.c > > +++ b/drivers/spi/spi-s3c64xx.c > > @@ -1461,6 +1461,17 @@ static const struct s3c64xx_spi_port_config exyn= os5433_spi_port_config =3D { > > .quirks =3D S3C64XX_SPI_QUIRK_CS_AUTO, > > }; > > > > +static const struct s3c64xx_spi_port_config exynos850_spi_port_config = =3D { > > + .fifo_lvl_mask =3D { 0x7f, 0x7f, 0x7f }, > > I'll come with a follow up patch on top of this. Having the dt alias > used as an index in the fifo_lvl_mask to determine the FIFO depth is > wrong. Not only because of the dependency on the alias, but also because > the fifo_lvl_mask value does not reflect the FIFO level reg field. > Playing with what we have now is ok by me, I find the patch good. > Yeah, we just have to make sure all our patches are taken in the correct order, to avoid any possible conflicts. > > + .rx_lvl_offset =3D 15, > > + .tx_st_done =3D 25, > > + .clk_div =3D 4, > > + .high_speed =3D true, > > + .clk_from_cmu =3D true, > > + .has_loopback =3D true, > > + .quirks =3D S3C64XX_SPI_QUIRK_CS_AUTO, > > +}; > > + > > static const struct s3c64xx_spi_port_config exynosautov9_spi_port_conf= ig =3D { > > .fifo_lvl_mask =3D { 0x1ff, 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff= , 0x7f, > > 0x7f, 0x7f, 0x7f, 0x7f}, > > @@ -1515,6 +1526,9 @@ static const struct of_device_id s3c64xx_spi_dt_m= atch[] =3D { > > { .compatible =3D "samsung,exynos5433-spi", > > .data =3D (void *)&exynos5433_spi_port_config, > > }, > > + { .compatible =3D "samsung,exynos850-spi", > > + .data =3D (void *)&exynos850_spi_port_config, > > + }, > > { .compatible =3D "samsung,exynosautov9-spi", > > .data =3D (void *)&exynosautov9_spi_port_config, > > },