Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3079365imw; Mon, 18 Jul 2022 01:29:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sud+tyoIfmwSbSzyF0dJnL3xlgUmfQ6wuhetckRGTVRjQrFZcM+hnCU3BupJngLdgYaXTP X-Received: by 2002:a17:90b:38c4:b0:1f0:59c0:570 with SMTP id nn4-20020a17090b38c400b001f059c00570mr36714571pjb.178.1658132973154; Mon, 18 Jul 2022 01:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658132973; cv=none; d=google.com; s=arc-20160816; b=IB1d/prPJgHoVMjDet4C+ouhpSFXo6sPZAJYi2Hgzp3Z5DGAWtDpwAeaFIRz6RvVZD hdZprckl0Qkid1ZBvR1rK+6y81ZBkqdqIUb6hOE66HjFyHfVb7SBIHyIEa6CGkqCJHPI +BfbU6Ydop1lboYXDNszFFEwT/qzp+mqnwsL8JuwindpxBDGUaBR9LYdywzjxZdF4qzS 58BM987UL37Z5MrD+2y70w+WaTsJnQ8+TH9JvjRA6kcuE73mKPghjnuFx7M84w598+cf v/QCjDZLsnZEdPlMaaPZlBHSDfacXiIpBHmF1M1pUbathu3mu+rLqmHXi5+kSFMdYyjb XrSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1FJ2Xbi4U1nLCdAU1bcQ1ggHHC4lioZUerJQ0U3NOGs=; b=T84RxCYiBjnJOTQRkIA0JqlfZ3352IuTtYlMvTh8BFgwBejTOFzNW8q4/biHwjTSGB VICHcWr/TZQ2JWymz92Li+jWm1usJUOMuyO0yN4YH+nMy30BZf920IpO6APBzc4pQfTI qYNWZkhj5/mPh0Zr0kVwuN62f39AlLh9abcvIYD1mLzeOsQ5BaenTxRdbIuEMswL/P/H EIQO7AhRiFio9p3S7FwQcUYs6QVh8ZR8YlC9V+3ekDKM73vyxyePyTGXYLXXOFhGGj3f iibgLc9aILHa//end+PKn1g/iH6i8GfR+FSOCAEJaS98suOwiCbc5ShwNwt7727d1Oin 5q6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n184-20020a6340c1000000b0040cf8f016b8si14833837pga.524.2022.07.18.01.29.18; Mon, 18 Jul 2022 01:29:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233653AbiGRIMs (ORCPT + 99 others); Mon, 18 Jul 2022 04:12:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232937AbiGRIMn (ORCPT ); Mon, 18 Jul 2022 04:12:43 -0400 Received: from maillog.nuvoton.com (maillog.nuvoton.com [202.39.227.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BC68512767; Mon, 18 Jul 2022 01:12:42 -0700 (PDT) Received: from NTHCCAS04.nuvoton.com (NTHCCAS04.nuvoton.com [10.1.8.29]) by maillog.nuvoton.com (Postfix) with ESMTP id BE51A1C811C8; Mon, 18 Jul 2022 16:12:41 +0800 (CST) Received: from NTHCCAS03.nuvoton.com (10.1.20.28) by NTHCCAS04.nuvoton.com (10.1.8.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 18 Jul 2022 16:12:41 +0800 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCCAS03.nuvoton.com (10.1.20.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1847.3; Mon, 18 Jul 2022 16:12:41 +0800 Received: from taln60.nuvoton.co.il (10.191.1.180) by NTHCCAS01.nuvoton.com (10.1.12.25) with Microsoft SMTP Server id 15.1.2375.7 via Frontend Transport; Mon, 18 Jul 2022 16:12:41 +0800 Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id 58E7563A20; Mon, 18 Jul 2022 11:12:40 +0300 (IDT) From: Tomer Maimon To: , , , , , , , , CC: , , , , Tomer Maimon Subject: [PATCH v1 3/3] spi: npcm-fiu: Add NPCM8XX support Date: Mon, 18 Jul 2022 11:11:46 +0300 Message-ID: <20220718081146.256070-4-tmaimon77@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220718081146.256070-1-tmaimon77@gmail.com> References: <20220718081146.256070-1-tmaimon77@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding FIU NPCM8XX support to NPCM FIU driver. NPCM8XX FIU supports four controllers. As part of adding NPCM8XX support: - Add NPCM8XX specific compatible string. - Using an internal burst configuration register instead of a GCR register. - Support FIU1 controller. Signed-off-by: Tomer Maimon --- drivers/spi/spi-npcm-fiu.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c index d5b4fe7b9b62..49f6424e35af 100644 --- a/drivers/spi/spi-npcm-fiu.c +++ b/drivers/spi/spi-npcm-fiu.c @@ -36,6 +36,7 @@ #define NPCM_FIU_UMA_DR1 0x34 #define NPCM_FIU_UMA_DR2 0x38 #define NPCM_FIU_UMA_DR3 0x3C +#define NPCM_FIU_CFG 0x78 #define NPCM_FIU_MAX_REG_LIMIT 0x80 /* FIU Direct Read Configuration Register */ @@ -151,6 +152,9 @@ #define NPCM_FIU_UMA_DR3_RB13 GENMASK(15, 8) #define NPCM_FIU_UMA_DR3_RB12 GENMASK(7, 0) +/* FIU Configuration Register */ +#define NPCM_FIU_CFG_FIU_FIX BIT(31) + /* FIU Read Mode */ enum { DRD_SINGLE_WIRE_MODE = 0, @@ -187,6 +191,7 @@ enum { FIU0 = 0, FIU3, FIUX, + FIU1, }; struct npcm_fiu_info { @@ -214,6 +219,21 @@ static const struct fiu_data npcm7xx_fiu_data = { .fiu_max = 3, }; +static const struct npcm_fiu_info npxm8xx_fiu_info[] = { + {.name = "FIU0", .fiu_id = FIU0, + .max_map_size = MAP_SIZE_128MB, .max_cs = 2}, + {.name = "FIU3", .fiu_id = FIU3, + .max_map_size = MAP_SIZE_128MB, .max_cs = 4}, + {.name = "FIUX", .fiu_id = FIUX, + .max_map_size = MAP_SIZE_16MB, .max_cs = 2}, + {.name = "FIU1", .fiu_id = FIU1, + .max_map_size = MAP_SIZE_16MB, .max_cs = 4} }; + +static const struct fiu_data npxm8xx_fiu_data = { + .npcm_fiu_data_info = npxm8xx_fiu_info, + .fiu_max = 4, +}; + struct npcm_fiu_spi; struct npcm_fiu_chip { @@ -624,6 +644,10 @@ static int npcm_fiu_dirmap_create(struct spi_mem_dirmap_desc *desc) regmap_update_bits(gcr_regmap, NPCM7XX_INTCR3_OFFSET, NPCM7XX_INTCR3_FIU_FIX, NPCM7XX_INTCR3_FIU_FIX); + } else { + regmap_update_bits(fiu->regmap, NPCM_FIU_CFG, + NPCM_FIU_CFG_FIU_FIX, + NPCM_FIU_CFG_FIU_FIX); } if (desc->info.op_tmpl.data.dir == SPI_MEM_DATA_IN) { @@ -664,6 +688,7 @@ static const struct spi_controller_mem_ops npcm_fiu_mem_ops = { static const struct of_device_id npcm_fiu_dt_ids[] = { { .compatible = "nuvoton,npcm750-fiu", .data = &npcm7xx_fiu_data }, + { .compatible = "nuvoton,npcm845-fiu", .data = &npxm8xx_fiu_data }, { /* sentinel */ } }; -- 2.33.0