From patchwork Wed Feb 7 11:15:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13548332 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 B7AB6C4828D for ; Wed, 7 Feb 2024 11:15:51 +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=/o91MMn4G/rLS3j4YbLOa/hmW9gSIe4QTNHLxLakTcY=; b=Re78MI9ymiZZjF uAlHbLBNQnElN/O75mGR06SUfMHA4OCmM5btC5l3V1X0uuT80/fwpzQRn29VnY/j7AKNh7Oukbf5/ Tl4dpR9IP5KYl7HAlAvkKs/g5Q/x847olYQqpwLSrcT8vvJiEK3sP5Gu/lU4loL4BQ/dwklfLu7l5 FYfH5yKdIghUa12r6pdNTYPMQHqbPgLp8A3vuVpXxBBbGZ+vGSu8NGuqL1TM+3zv3GxWATpcyjn5c MH2HdoEZN62YNqk247CA79RVPd/VlD9cZeU/KLWFD5S5L5atbZIpvAjTVpZ2C/9DiDSfkK0kz1o9c E5am7J7ZL+OaaIlbn/pQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXftz-0000000ASTi-1hPa; Wed, 07 Feb 2024 11:15:39 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXftp-0000000ASJR-0NhO for linux-arm-kernel@lists.infradead.org; Wed, 07 Feb 2024 11:15:30 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5115fcef9e9so581416e87.3 for ; Wed, 07 Feb 2024 03:15:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707304523; x=1707909323; 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=Dn0uxZFDo6NWePr2qdwdP08ijlsAxDoEPw964FSIz1A=; b=TErheVedEHejLDwXs/dfQXJPp/BlcJsONyJVactd29cpVYgoWtRsnwPWHUkAQp2omm 7bQduHJ0tcxoQYImvJA1vbBoKW+SEfkOVXj4MpQX/hSXxIfMYtjiASUyTUWKSRcD0YAH k4TTg/UH5kDAl0T89PRraft1NomtNU4TMcE/rXq6X8CbTzQzqMJsN5eUxff3WXIUmA9E P5p6y7/1Q6bpf/57/TWuevIxGxJDrqk6/oh3H2twuubH9+anxH2e2qMMxU9wr6QuN0aJ jo2KfF6+yFJKc99p5Jb0BE8rNdMwZQe1SjHRbtI3sBGdnrEj0/NOxasBVb0uVSYA2Wej VrUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707304523; x=1707909323; 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=Dn0uxZFDo6NWePr2qdwdP08ijlsAxDoEPw964FSIz1A=; b=kJGUCQd6MPWcnNA5USXRGg7+/sM4jcirDZdUVCfh1lgTPIY7NOOiEFmBtLRXkNfDVk F80i5VMOoEtYKlocB5uycpKCjabrDCGRZnJ8cMJ48UHscGDegEGeVNcQQZP4Sq4CMiup dQLLeDyF1LL6sPJRwAQ5PQkCDq/wyguFTY1FyYbHBbYmLE72o4WAByfTe8x6HhN8n+22 1dImJESVlDD9N3iPTipNGw5C65mylDLyIWAcuNTETJuKeYzZfVevE7eWgUYmxOIb7Ccx H5WT/mfFZxt5kiniF/rh4k6iKRz+UTOlKv+GJlKAOzdFPqBm+gHRN6nbzKLxj97lOvFe YQ6w== X-Gm-Message-State: AOJu0YzcmqsJIaZFw7HrLPklFrRZA/jN4xjMZw1Lvh/ipiNfvvI+O86k EQzqvt3b+yI2k63s9Dy0lXf18nwbYsaeVOzbXeNh/Kc09oQHyrqt++s68gCriJE= X-Google-Smtp-Source: AGHT+IE5eIKLuUmb8h+vJQhTopUxE+vxpnmBvmCs+6cqfMZAcpiMEAKVIc99ZTC/OMFtO9lArP2XLw== X-Received: by 2002:a19:f80a:0:b0:511:5e49:766 with SMTP id a10-20020a19f80a000000b005115e490766mr3055134lff.23.1707304523154; Wed, 07 Feb 2024 03:15:23 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWpHmBFshfk+OSUXB7ANNEbw1MqbQNWZ1mwdFgbfeK2iC+AXM8eorwCeMYn6Qk77+424RjJ4E7ST0wUsphxqtaN4qo+VFdiEgSheX4t1LqFECen46n0V7MHAhqv4BUlrmCZICQRZdDA23T5iQWfsJtKJLDwoXSk5Z73VJDuhOwH9xL79Bs8GtSnqU+EwuUM3uQ8Xrf59laCDWiQCCiPEWpU6hS3m1/ag4kNIcmEgXQuDu103ECJC/afRpf8IIDuNqfSXRCJW639Zhv730GM4m4EgAcBRtzlfxoXuMagO7Pp2twztw4u7RNL/7BD5rKgDeKbDPj7Ws0a+x223wUqbMOO2byVhNXsNPI/pDNxb3n8zUrrHUTKlGFcZpyFtppRP9TKDUfv/IxZ4Vi7J32S+5OB+XiaDbU0M1RzNbIlEsdVGWEzYu5JOj6y3bwz6xyFRC46AyshRTpHg9dk1JvpzcSX9eULRFzrejotGkif+etjoANhVgRpvAZ8AMHCTbbK+EPyXaR7WA3i4G8s3SENMOjoR+oJ2FH9gH3xLMYZBdeO2i1r22TQULwWZH5lLEThSob/74OD+55soHL4ffGRKeCY9w== 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 l14-20020a05600c4f0e00b0040ec8330c8asm4983260wmq.39.2024.02.07.03.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 03:15:21 -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 v2 4/4] spi: s3c64xx: add support for google,gs101-spi Date: Wed, 7 Feb 2024 11:15:16 +0000 Message-ID: <20240207111516.2563218-5-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog In-Reply-To: <20240207111516.2563218-1-tudor.ambarus@linaro.org> References: <20240207111516.2563218-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-20240207_031529_267113_3F059404 X-CRM114-Status: GOOD ( 12.65 ) 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. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- 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 014fcc933c90..7ab3f3c2e9aa 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -17,7 +17,7 @@ #include -#define MAX_SPI_PORTS 12 +#define MAX_SPI_PORTS 16 #define S3C64XX_SPI_QUIRK_CS_AUTO (1 << 1) #define AUTOSUSPEND_TIMEOUT 2000 @@ -1534,6 +1534,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", @@ -1546,6 +1559,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 = (void *)&s3c2443_spi_port_config, },