From patchwork Tue Feb 6 08:52:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13547040 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6635AC4829D for ; Tue, 6 Feb 2024 11:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ND7Jr+c0/YJjlkleOTWyTtwKtyoxvigdVH7X/643DVA=; b=eWNY4zVjKOM9Zq dnNiw6i7UdP+KWPgDjsb3Ftx6kDBKpz68t99ZYr4xcT3B4MEw2XAPKpWGlPwvuPvxHYLIkQc2CHM4 uTdjTneiwY1QA1o/Jadcg/it8weANr5W++ZbNKbaJ+y0hpwg9x5SNUMaeJOvdWSd3X4lbf2C+VLbY WQwSRqGC1Dj0zrpuiuoJuVnnXmj5qWe+FSSc5i9FdVMKeJZIQn5ht9PEj817TT/WMYp57ZN0Ly9Ua sgIkuUh00ZBGs0uXTOr7JpvWXk74eVWLdR1CELDfFAgwCzg5E6f0MUAWZh9Xn32Elb6h0jElFoWlf m+BMGUKopAJbkuwCoDIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXJQW-00000007G4l-2NLh; Tue, 06 Feb 2024 11:15:44 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXHCK-00000006XSA-2bBR for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Feb 2024 08:52:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Vgk20b1Z6sAxu7dsDANnrkj2LKv2bPazc+HqZKqdJoY=; b=VrdVJb03ccdEhiXihQ6s8JSu/Z v5sGOM1jVw5RR2JMAe51RVGfWqLRUGHdxMoHMf87bvRfFUsu7ankhD008R/oQKpPo05KSskpoRbKO PMcCoFaLDsyqh5fnG1oORvN9Xqo2yLolHNG+tPbtjSFRFeBiDck4BpMtyXdCL2UCiztnNmDArKpOM J/XNclKAxpvlbOOW0Mkf0/E/qhUeKfwoaFoAvxEBHA94RWlO4Q4qfeHkKU000MIPqGzYrw9rnXv+G IFFLiSi9rC5JB1/nWgkyOIZVmrjJZkJrCqPEk+DCXPtP7u67A1/OA1rH/f8VU9oqNoXQ3C7XfRBMg UDRdBo5g==; Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXHCG-0000000CODH-2Zo3 for linux-arm-kernel@lists.infradead.org; Tue, 06 Feb 2024 08:52:55 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3394bec856fso162345f8f.0 for ; Tue, 06 Feb 2024 00:52:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707209571; x=1707814371; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Vgk20b1Z6sAxu7dsDANnrkj2LKv2bPazc+HqZKqdJoY=; b=CLuhoKQek18Pwv0olahccgy3aonyBmL4oDdqMX2G500uIa5DYebz0fDXtYnm6kkTSG AGW6vyHhvoj8Hyj4F1wsiOMAHMndkoDwKvWvLBwq5HoEB/kN63jwkOiGZi8+iQYt1ZQg AnTnC1YXVSe0eEPRKu0MrE8x9yqXo/VoiCD/DzwuIo/2M8A+nm+gExszvzYyft87fVeD Lse00zYCvVVMcKWlby3orCMS2UYS5QcNL95QFH0IsYK72xvfaprdgXcteX/gYQlTIvov g+Nd/53N+KWO2lr+gdaPulKwiMyB10aP50W/ZPa3+qZ4dgxbnSG+65C2On4czge6AfJE AGIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707209571; x=1707814371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vgk20b1Z6sAxu7dsDANnrkj2LKv2bPazc+HqZKqdJoY=; b=PpGKQHHqFozM0x/mCBSP8jNIgWBAMD+8Hft4jFyA1edOzdvhJAHcVQrkmeCrkc71wq lDT+ibo91FB3jdP3pvplbDVKtFX/lXQCyJNYJTEA4PeVCgamAZtcIZLW7qnyD8o4Qlzt 1dEVV4pPXa0qAdF5sQT7B0relfSjxzPTYp9SI71yXOOOzjCAqCGZP44Oxgb/NwrhOpXT yK1X/WG88eZX9v0+13OoxYH1jGuaLfxPbCrG7DZq30mt6R7kn+a6vwungoycBPtN2JqR 8XGNHebyZPgeyr7dyU89hpfSQc7xUIUJI2Kuzoqnj/zf2DX/EJqKZzDAJLMRNoGTeAx0 FH0Q== X-Gm-Message-State: AOJu0Yzk4R7/j9Fze/nkTYOgCP31lnqlnvp/edXxwk0AoPfwfqrRGr5m 7yAyopO627AEl1xDGgKEvzCtUwNpm/FLREmrE5gRUQejC3XU6XXxPM5ZU24EI2Y= X-Google-Smtp-Source: AGHT+IFxujVssWEiqmgO6bi09eUeCSXUTDLiXgomG617SNK7Y2jrytsLzsqe8YugL4+0WqsUaUGoRg== X-Received: by 2002:a5d:444a:0:b0:33b:3aa7:3b80 with SMTP id x10-20020a5d444a000000b0033b3aa73b80mr735235wrr.15.1707209570962; Tue, 06 Feb 2024 00:52:50 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWiauRuBcFvG8IhewBVIQJKg4NAHxVG6ayQFJPqsd+Sz1L+Z6KUJ/ke/7A2Jp1CzjZetiLMuh7F6Qxt/B2+5Ah9FFrn8saFp1ldnZtCFkCvnwgNhwWQbZ3fI14qQeAGnBjVt5FfYpBPyk8XUo8MyUDwqWKFqTSRk6qFuurmI8ezF9D+HevlhKyOtk+DnCUDkQzyBqj/nun6RK9jn8SZEUmvdNzwCZpb28PCo0W5wgki3ekC6td0taN99bUDT0dLmRjpobe/6GKuvaZK9RNqCV3a2j/yEuSDsLHGdaIo0GyQbn+FB7rNp5YkMdnNpOtoaiEUjCO4Mh8P6THC7YqYSSEgwXLDpEwUzfK3rxEz0KKJ5e8MHAmhWUwDomSo8qpLwSSau85/ZEBUzCmrm6dH3nEZ4LqGZzQkPhD9yzsG+d5fwlyd+4Lzj5MHonbDDel6ZRWeg12ZebHQRm+5svNxpUH+wlJvUoKUJPpqG7ymqNlxOwhZgkasUdym3Smsjt6O51Psw8Ewm/ILlj94zWT/pYIflr//PN+2HsFTkFX+0qcap8D2bSOxCuztnISU41DDs4cGsWC8M/qBAoykebwoEnDlsw== Received: from ta2.c.googlers.com.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id z10-20020a05600c078a00b0040fe078fb03sm1221591wmo.32.2024.02.06.00.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 00:52:49 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, andi.shyti@kernel.org, semen.protsenko@linaro.org Cc: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, robh+dt@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, Tudor Ambarus Subject: [PATCH 4/4] spi: s3c64xx: add support for google,gs101-spi Date: Tue, 6 Feb 2024 08:52:38 +0000 Message-ID: <20240206085238.1208256-5-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog In-Reply-To: <20240206085238.1208256-1-tudor.ambarus@linaro.org> References: <20240206085238.1208256-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240206_085253_766257_6B40FB6B X-CRM114-Status: GOOD ( 12.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for GS101 SPI. GS101 integrates 16 SPI nodes, all with 64 bytes FIFOs. GS101 allows just 32 bit register accesses, otherwise a Serror Interrupt is raised. Do the write reg accesses in 32 bits. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index cb45ad615f3d..9ad0d513fb30 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -19,7 +19,7 @@ #include #include -#define MAX_SPI_PORTS 12 +#define MAX_SPI_PORTS 16 #define S3C64XX_SPI_QUIRK_CS_AUTO (1 << 1) #define AUTOSUSPEND_TIMEOUT 2000 @@ -1538,6 +1538,19 @@ static const struct s3c64xx_spi_port_config fsd_spi_port_config = { .quirks = S3C64XX_SPI_QUIRK_CS_AUTO, }; +static const struct s3c64xx_spi_port_config gs101_spi_port_config = { + .fifo_lvl_mask = { 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, + 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f}, + .rx_lvl_offset = 15, + .tx_st_done = 25, + .clk_div = 4, + .high_speed = true, + .clk_from_cmu = true, + .has_loopback = true, + .use_32bit_io = true, + .quirks = S3C64XX_SPI_QUIRK_CS_AUTO, +}; + static const struct platform_device_id s3c64xx_spi_driver_ids[] = { { .name = "s3c2443-spi", @@ -1550,6 +1563,9 @@ static const struct platform_device_id s3c64xx_spi_driver_ids[] = { }; static const struct of_device_id s3c64xx_spi_dt_match[] = { + { .compatible = "google,gs101-spi", + .data = &gs101_spi_port_config, + }, { .compatible = "samsung,s3c2443-spi", .data = &s3c2443_spi_port_config, },