From patchwork Thu Jun 8 16:30:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13272541 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 51166C7EE2E for ; Thu, 8 Jun 2023 16:30:48 +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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gfOmJ77TdkB5cnAgKin0zM5Nn35faztoHzuxi5Q7NOM=; b=lNxujo9TQDNtep 8E/qWujHXu63nLHCcSKr8RbDpdV70dChEFbF57sgtETvNQiQ3iSDjtVqGEMyxLRGUv8Kzxh55Yp25 SrquSPMFWDAx989Z3Q1czKAPjy/lHs7XS3NjDUuL7uTI407wp5T7w0khA+CGjiRJHYXdQjXAQfeZQ gaZYc1NR3XKA3D5iTvTwO2/V1PzqYXoqNgE/VaQg4BkcY+KhL5q4xfPLxL7tf3sg283Jjm68+9uit 9coh8GrZMqF1HyuH4Vz/f+wm7CvxLniVUGHpt/pWYBS8Z1P11lD4JuPyy+9J0knuJxu6moN2lMNlj +ODBEUW0V32DY2OnklCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7IWl-009svW-1h; Thu, 08 Jun 2023 16:30:23 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7IWh-009stw-1M; Thu, 08 Jun 2023 16:30:20 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9768fd99c0cso400420866b.0; Thu, 08 Jun 2023 09:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686241817; x=1688833817; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=vsbB0vH5LsCtdiDXzwFJEcjnZ1bqcJw9xluET8hnyJA=; b=hkZlfrj08DAP1djftJGmo6uA8r5XJM3qG/0ifHmdMHjFMPJUiG7J4+Q2yw+TJjY5bw KwIxIe8huBGGJ6hrpnTKR/Q/elpqCWAhZAgWMWsbnYVO0Yh/dlQMKpzxinQRhM5Lt5SC 16O9tGJ2z3Z8zL8PCKQSfFc5xh7xgjuOWEp7VWn9xNRc/v3jMWtMd/cwx3pdJpMFQ+G0 VWmqCUpWgFkt19Y8W5FubQmpuT8X+/DlsTRUL4Kmg065yRmnI8Z1S8O+x+xJKIqJFyxM x6mkccOU7yqrG1K9P46lbK5raTGfY4CDv3r8uVnspCJY3SwHjxuqKuM4+VCMGdnmgRJY 0bzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686241817; x=1688833817; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vsbB0vH5LsCtdiDXzwFJEcjnZ1bqcJw9xluET8hnyJA=; b=MU+z6+wXUbU9kEejJHfNqDlHHFSCxcz4GzX2vsyuzLydx8J71iMTXatfgQhZKaTML4 ZKsiuUzEnF4nTfuojGiCpbHvH3D7nHhkxv+fYd0XJeIb1MmVA+YKqyIi7fRKbOug2WQk RXgm6crfhlfIV4AvjyJZaXgHGQeEO2hjlryTF9SeEfvq31sOuuu4dK9IsH6xAlTQICrQ /X7OLMRcjd+R1LDmmVHCNfi4idk0weuIvOdSQoFrHz4bXLh/o3dsz8rZ8hQnclcDn6KW NuDLz2W5d7sAptS1vI+kjOC6+y6yWhO8Nsqay307uzhP3YpWvAEBjPoNexH8LLozCR26 4Snw== X-Gm-Message-State: AC+VfDz18wqRmx6sxwcQGSXCzxERBrbah22Q+UrCB4V+igLYPETaH2oQ autyYOH0yl3VX5QdcA2qU7A= X-Google-Smtp-Source: ACHHUZ6iMNVDTMeZdZzaR4cW1YP03V77zJAHgdi0d1rDcx262lUw2Jc2Wb32SEF9sMcsqRnfsVwf9A== X-Received: by 2002:a17:906:7955:b0:977:cc28:d974 with SMTP id l21-20020a170906795500b00977cc28d974mr168921ejo.14.1686241816863; Thu, 08 Jun 2023 09:30:16 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id b16-20020a170906151000b009746023de34sm32160ejd.150.2023.06.08.09.30.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jun 2023 09:30:16 -0700 (PDT) Message-ID: Date: Thu, 8 Jun 2023 18:30:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Johan Jonker Subject: [PATCH v1 1/5] mtd: nand: raw: rockchip-nand-controller: copy hwecc PA data to oob_poi buffer To: miquel.raynal@bootlin.com Cc: richard@nod.at, vigneshr@ti.com, heiko@sntech.de, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, yifeng.zhao@rock-chips.com References: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> Content-Language: en-US In-Reply-To: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230608_093019_461217_3506373A X-CRM114-Status: GOOD ( 16.21 ) 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 Rockchip boot blocks are written per 4 x 512 byte sectors per page. Each page must have a page address (PA) pointer in OOB to the next page. Pages are written in a pattern depending on the NAND chip ID. This logic used to build a page pattern table is not fully disclosed and is not easy to fit in the MTD framework. The formula in rk_nfc_write_page_hwecc() function is not correct. Make hwecc and raw behavior identical. Generate boot block page address and pattern for hwecc in user space and copy PA data to/from the last 4 bytes in the chip->oob_poi data layout. Signed-off-by: Johan Jonker --- .../mtd/nand/raw/rockchip-nand-controller.c | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) -- 2.30.2 diff --git a/drivers/mtd/nand/raw/rockchip-nand-controller.c b/drivers/mtd/nand/raw/rockchip-nand-controller.c index 2312e2736..cafccc324 100644 --- a/drivers/mtd/nand/raw/rockchip-nand-controller.c +++ b/drivers/mtd/nand/raw/rockchip-nand-controller.c @@ -597,7 +597,7 @@ static int rk_nfc_write_page_hwecc(struct nand_chip *chip, const u8 *buf, int pages_per_blk = mtd->erasesize / mtd->writesize; int ret = 0, i, boot_rom_mode = 0; dma_addr_t dma_data, dma_oob; - u32 reg; + u32 tmp; u8 *oob; nand_prog_page_begin_op(chip, page, 0, NULL, 0); @@ -624,6 +624,13 @@ static int rk_nfc_write_page_hwecc(struct nand_chip *chip, const u8 *buf, * * 0xFF 0xFF 0xFF 0xFF | BBM OOB1 OOB2 OOB3 | ... * + * The code here just swaps the first 4 bytes with the last + * 4 bytes without losing any data. + * + * The chip->oob_poi data layout: + * + * BBM OOB1 OOB2 OOB3 |......| PA0 PA1 PA2 PA3 + * * Configure the ECC algorithm supported by the boot ROM. */ if ((page < (pages_per_blk * rknand->boot_blks)) && @@ -634,21 +641,17 @@ static int rk_nfc_write_page_hwecc(struct nand_chip *chip, const u8 *buf, } for (i = 0; i < ecc->steps; i++) { - if (!i) { - reg = 0xFFFFFFFF; - } else { + if (!i) + oob = chip->oob_poi + (ecc->steps - 1) * NFC_SYS_DATA_SIZE; + else oob = chip->oob_poi + (i - 1) * NFC_SYS_DATA_SIZE; - reg = oob[0] | oob[1] << 8 | oob[2] << 16 | - oob[3] << 24; - } - if (!i && boot_rom_mode) - reg = (page & (pages_per_blk - 1)) * 4; + tmp = oob[0] | oob[1] << 8 | oob[2] << 16 | oob[3] << 24; if (nfc->cfg->type == NFC_V9) - nfc->oob_buf[i] = reg; + nfc->oob_buf[i] = tmp; else - nfc->oob_buf[i * (oob_step / 4)] = reg; + nfc->oob_buf[i * (oob_step / 4)] = tmp; } dma_data = dma_map_single(nfc->dev, (void *)nfc->page_buf, @@ -811,12 +814,17 @@ static int rk_nfc_read_page_hwecc(struct nand_chip *chip, u8 *buf, int oob_on, goto timeout_err; } - for (i = 1; i < ecc->steps; i++) { - oob = chip->oob_poi + (i - 1) * NFC_SYS_DATA_SIZE; + for (i = 0; i < ecc->steps; i++) { + if (!i) + oob = chip->oob_poi + (ecc->steps - 1) * NFC_SYS_DATA_SIZE; + else + oob = chip->oob_poi + (i - 1) * NFC_SYS_DATA_SIZE; + if (nfc->cfg->type == NFC_V9) tmp = nfc->oob_buf[i]; else tmp = nfc->oob_buf[i * (oob_step / 4)]; + *oob++ = (u8)tmp; *oob++ = (u8)(tmp >> 8); *oob++ = (u8)(tmp >> 16); From patchwork Thu Jun 8 16:30:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13272542 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 D9200C7EE29 for ; Thu, 8 Jun 2023 16:30: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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WEH/aIxWhI3wI6EPJKCOsMG6ifu3ORtm13s5vd0vKCk=; b=v4LukpkAU6fx0q AgkOQ9JeUNeDFbetKf58NkxDnTvwSrX0+20gglpxTnRtl4m8+3ky15do8LDUGAVDl/1d1qGKxkinz 7FVVlVDGjP6332UT6Pzedh8HGItgBX2VN35D2zCN3RLHp+4nMkWqc5WUIMzsjAFtqHvF3ZalpzklU kbomfoYU6Mx+Vg4wyLBDDlJ2PxuIrqEt8vzptzN02TC0kb3oKtvp+a/j4cgNqrZijfHD6PPXXXFw1 EaNggRt+UtfEtuuFCRAb5VGuRoQIgCepIohP8NAky5gtOQS70TxsTwuTNJQc1wrE0zH8x+1azSYKI TC5BlEPhNamjAAG7/ZNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7IWw-009t1c-38; Thu, 08 Jun 2023 16:30:34 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7IWt-009syI-2T; Thu, 08 Jun 2023 16:30:33 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f60a27c4a2so975554e87.2; Thu, 08 Jun 2023 09:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686241829; x=1688833829; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=2JEi90Ldlhgb1TX3KGxyOhRscyzL8bDaJwIjdpZwAHM=; b=oiNID0CUe1AWbiikTsKX2eDTJ0S9WSJOOdI2miZOoBfeO5yy93DYpwIqMc192Y3JFQ vK5U1z2x7zv6jn0X7WqLjBW5Co7px5er5ntKxr3Hvcee/IVS4/XBk7h6XkGh/gAQNM9r BrApdp1SdAquHLYanvievnjMvG/N0gj63BNWmPusVw2PFP4DwprMzwfrz7nJPvIylV85 RaGQwFqelBeoorNKYr+zdQG5jDevAGbh2PTGejNT3MHLBt8J3Ag0DuPIdzKEehoCnP5n T2Lf65eyjyEcAVTRdH08gGjOFSIpdgOxuNpPAxkZGpCvWf0JzFq4xUYkOFqJaRNNDsp6 sqzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686241829; x=1688833829; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2JEi90Ldlhgb1TX3KGxyOhRscyzL8bDaJwIjdpZwAHM=; b=DBu4UEwDMNiV3r8+VMplAZzgxGEVqYcFkkUc2sp05/9QakXudXQXe5BxcZ9i6PZux3 mlhruZX2mRXUx1hBeQNws25mZXUcpjWbf9YAmgB3FuXZcm9XriBrphW6PbdEUyBfTV7s znftUKZ0pDm0ROjhYO9/Zs/i4lZYjLDed23VHsmiZGxey6vJ5OyS+0ubb5bhORYthBU+ EIN9pvILoLcxwnQGArNfJAKfd0N1rbWVbv6YN90QOMPPbKwpL1UTxrOEasHu76TPUKKq 9/X5euYGLnZqDr2j3BYJCew1Jso/jHlpM+AcNhM6GgZHoWsLyxrEjvVOQOdpT8JlMG0Y CXeA== X-Gm-Message-State: AC+VfDxe3Fsu9pSoaKerK1C+g2e/koJiGwtZZj/zmjelyLys5aNQ/Gcm re77LFwFACLtHD6lPOyQs8I= X-Google-Smtp-Source: ACHHUZ6klAVFi77hcHpFJEJ4Ipf8Zzlq9+RqBHfp6OUAfEq7a2ufitVsxLKZ+8168eWyQSz2KBEiqg== X-Received: by 2002:a05:6512:14b:b0:4f4:4cd4:2586 with SMTP id m11-20020a056512014b00b004f44cd42586mr3699557lfo.20.1686241829063; Thu, 08 Jun 2023 09:30:29 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id i20-20020a170906a29400b00977fb2fb44asm52422ejz.28.2023.06.08.09.30.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jun 2023 09:30:28 -0700 (PDT) Message-ID: <4d9473ce-c167-47d7-e37a-7b39915a724c@gmail.com> Date: Thu, 8 Jun 2023 18:30:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Johan Jonker Subject: [PATCH v1 2/5] mtd: nand: raw: rockchip-nand-controller: add skipbbt option To: miquel.raynal@bootlin.com Cc: richard@nod.at, vigneshr@ti.com, heiko@sntech.de, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, yifeng.zhao@rock-chips.com References: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> Content-Language: en-US In-Reply-To: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230608_093031_808732_2313311D X-CRM114-Status: GOOD ( 11.23 ) 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 On Rockchip SoCs the first boot stages are written on NAND with help of manufacturer software that uses a different format then the MTD framework. Skip the automatic BBT scan with the NAND_SKIP_BBTSCAN option so we can run it manually. The NAND_NO_BBM_QUIRK option allows us to erase bad blocks with the nand_erase_nand() function and the flash_erase command. Signed-off-by: Johan Jonker --- drivers/mtd/nand/raw/rockchip-nand-controller.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.30.2 diff --git a/drivers/mtd/nand/raw/rockchip-nand-controller.c b/drivers/mtd/nand/raw/rockchip-nand-controller.c index cafccc324..f56430f6c 100644 --- a/drivers/mtd/nand/raw/rockchip-nand-controller.c +++ b/drivers/mtd/nand/raw/rockchip-nand-controller.c @@ -188,6 +188,10 @@ struct rk_nfc { unsigned long assigned_cs; }; +static int skipbbt; +module_param(skipbbt, int, 0644); +MODULE_PARM_DESC(skipbbt, "Skip BBT scan if the NAND chip contains data not in MTD format."); + static inline struct rk_nfc_nand_chip *rk_nfc_to_rknand(struct nand_chip *chip) { return container_of(chip, struct rk_nfc_nand_chip, chip); @@ -1156,6 +1160,10 @@ static int rk_nfc_nand_chip_init(struct device *dev, struct rk_nfc *nfc, nand_set_controller_data(chip, nfc); + /* Skip the automatic BBT scan so we can run it manually. */ + if (skipbbt) + chip->options |= NAND_SKIP_BBTSCAN | NAND_NO_BBM_QUIRK; + chip->options |= NAND_USES_DMA | NAND_NO_SUBPAGE_WRITE; chip->bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB; From patchwork Thu Jun 8 16:30:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13272543 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 6C035C7EE29 for ; Thu, 8 Jun 2023 16:31:08 +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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DowR0hr3FbLC51XVgN8nG+AxlFAfvMgETs4Yq1jjBwk=; b=JmqjBBfeR8RP5o NhEtCAUxWfLoZbzCOWA+tWHqHKevKzzeowVdtmpSU2Vg0BLER14AIbT/avSZiy2UIi39m8qZ89RxS us749ECXKB9eAROROfi/qRYlN8gtp9wDGJQrdbFHQPfDAQQN09GKLSjNoWcqSLqFUNL07Jq8qMG9P juTofjGv0Yt+JkoQKZm3FH0YqyzwcqA13PHdyEEZOFl7BFAZS7o9mymqBquGFAoh8poLU8dQvnA4D gMXmfFAyk8WW2tsnnZ94Ngb3PzPd9s5nMF+NXAcnjfL268795pnovW/SycP3wE6qUHSj2ljXKEHHY LMThssiGWUYVzgVu3m3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7IX9-009t9C-0U; Thu, 08 Jun 2023 16:30:47 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7IX5-009t6H-1o; Thu, 08 Jun 2023 16:30:45 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-977e7d6945aso153902366b.2; Thu, 08 Jun 2023 09:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686241842; x=1688833842; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=8JK6nUED3jU/yRq5Kxia5FQ+fi4P7t0pEwpfr3iX2Go=; b=SSUKz1jK9Qed9t+uRHaFgw0LA0tr/oknZHzTeub9Vqzp/NzBqntpHfr6v3zXDpEKi1 LPJMzzZxsfB/77Xdxp4oUWCRR7sl7ibeHk2L+VJ6IB+SMfmIGOtaJRulnEL64DPClwzz ekLt0OMAizMxolBclwsuX5Tqz+1rs6ADmZaYo9fl0j+kWDuZV18toFs7/39EiAQg1GTl qK1ffa4v+rmFOKWgCqYMv4ML3vb4sFmzq+g29+/0HX6q+sJv5pCqnBb1fVqvl6AlpQKD N5Kd9sksfVKH1soJJ3x3Sc5n9RGrTH4vNhUlut8W3+rt9aFPrT4PBvKtP2ImF6/CpikE +HxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686241842; x=1688833842; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8JK6nUED3jU/yRq5Kxia5FQ+fi4P7t0pEwpfr3iX2Go=; b=fO5cLOcNqREe2AD9pbagPpn5PPguKTiamlCwFwdmKZspFawpmUD8j+5NdbnxbFSuq6 tZ9J7huuMehu44Hvd68Q30uHyu4TgRCENEuNXUymqM6ovNJHL2pXviJdyPi6iFNerlRH atEjXFVAQNFxLD7Q4MPvZKasV+9gIAA3xR6PkOzteHqf4gstEl9i9t9qptwJZ13LkGpO tzFRjp8GLCtOx7vfaXZIPg0HknnZXbIDRBFebM9RlS2VI9P9m4bn0DAY117zt/u975Uu iDli4tMsSJ7XtrzJHhpkNfacEQ+ocu5j0+EdWjMl2HlAS0r5gnuQ9tRjhlOMziD5k9JP k7yQ== X-Gm-Message-State: AC+VfDyVKbO5cXdVsc3HcDHJUJ1Y/BVj+ATwTKhetbIr/7SPVa1WNBCD 2IoZX2xAMYvEnsk10GCHYzs= X-Google-Smtp-Source: ACHHUZ6J3DH1PqULJJPmTRQ1btMyatdURfw3vUzdQur0Ka2JugVYB02NEIPk2c0MUUGZggvS5kS+vw== X-Received: by 2002:a17:907:da1:b0:958:cc8:bd55 with SMTP id go33-20020a1709070da100b009580cc8bd55mr345832ejc.0.1686241841862; Thu, 08 Jun 2023 09:30:41 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id o10-20020a1709061d4a00b0096a742beb68sm24919ejh.201.2023.06.08.09.30.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jun 2023 09:30:41 -0700 (PDT) Message-ID: Date: Thu, 8 Jun 2023 18:30:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Johan Jonker Subject: [PATCH v1 3/5] mtd: nand: raw: rockchip-nand-controller: fix nand timing default To: miquel.raynal@bootlin.com Cc: richard@nod.at, vigneshr@ti.com, heiko@sntech.de, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, yifeng.zhao@rock-chips.com References: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> Content-Language: en-US In-Reply-To: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230608_093043_611532_8FA7A993 X-CRM114-Status: GOOD ( 12.36 ) 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 Somehow not all NAND chips give a valid timing setting with the nand_get_sdr_timings() function. Don't consider it as an error, but fall back to the default value in order to continue to use the driver. Signed-off-by: Johan Jonker --- drivers/mtd/nand/raw/rockchip-nand-controller.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/drivers/mtd/nand/raw/rockchip-nand-controller.c b/drivers/mtd/nand/raw/rockchip-nand-controller.c index f56430f6c..e39431cfa 100644 --- a/drivers/mtd/nand/raw/rockchip-nand-controller.c +++ b/drivers/mtd/nand/raw/rockchip-nand-controller.c @@ -429,8 +429,10 @@ static int rk_nfc_setup_interface(struct nand_chip *chip, int target, return 0; timings = nand_get_sdr_timings(conf); - if (IS_ERR(timings)) - return -EOPNOTSUPP; + if (IS_ERR(timings)) { + rknand->timing = 0x1081; + return 0; + } if (IS_ERR(nfc->nfc_clk)) rate = clk_get_rate(nfc->ahb_clk); From patchwork Thu Jun 8 16:30:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13272561 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 BFE17C7EE2E for ; Thu, 8 Jun 2023 16:31:23 +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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=h95UzdAh8AKVWi0xQezXzcv3tTpZBLRNwxblx09X4zg=; b=oQZQgkwRJ5pgH3 eupqcsQqd88hCpLaCk1uRZ4JRyS8m52W2wawCVyT7geLxii0WFO1fjyr7h4gzUglnyMMtXbmEf7/T EU5i00ZGQL+9d2Q4ceIke4+cXf95k/vxZc8qkpmIF7hYa7oluBc6tHukzjvFAo+aTbBGyDeXAuoL8 HbELoKE16RJ96Lm+tZxNI1FTKv0sFsSroTxiQUeamuaawv96+I7xWb5aOUgW3ldvmHSsAEup4RYco r8NgHmGvOnvZg5vGOiG8u9InuQtAEkwEBiwTd1n0pBr42u0ztg9/kAgADfzf1wKVl0UyQmuHLYYB4 4AOgxEjif5K/TJAqK1ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7IXO-009tJY-2M; Thu, 08 Jun 2023 16:31:02 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7IXI-009tEL-1a; Thu, 08 Jun 2023 16:31:00 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5147dce372eso1270101a12.0; Thu, 08 Jun 2023 09:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686241854; x=1688833854; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=/+lWdxdyjn98DSIsUOubwz/2jxFFE94HkilpG/MpBg8=; b=lnFfQTWL93+gmaq67BRhQvuLlxlzloh39fybowrXPtD+Ttb2I6xa8z0AYOQ6AZQz7P 3PdYvcE/9ePKM4Qbs1nLAfWrz6xuqYGMI5VjVysieAVPYWU0iu+7pki8NRQb/EzUOGQ9 CpKARlQMgFXYbManoFWczAg4I8OYbCj3FEJyP9qCczB8rr8W6ZiJZM8z0LFsRjceTfOi DVI0l830g+qr9wmvqrtLx97Tw7lTOb6s/VAtHEKwewQBudGog5WE9V2hCPZ5qssX5UxF jittVF2oLYZ5OYvVJB1ygq/IKHFIizTZKpKxEu0kEDJ4JKGm+qK9JolleF3AygvlwaWe Q6Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686241854; x=1688833854; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/+lWdxdyjn98DSIsUOubwz/2jxFFE94HkilpG/MpBg8=; b=RBx+f+ro9S5NNNW+2+AUdiK5VbbXKsdzdSyNhtloeMN9q0wohig018yhfgvVT3cqBr bKts/uocBFTdLoj255Z9tVWu/GTsOlQWbsxLgIuCtozdTcHnl8KKqB0YpNAzmgFki9UO Q8bfghaUZGd925jrXxf7KjhiNfVGevZ+gv8qR9e+cXRYXCptjQSH3DUgC5fsdfFtkSKt 6zuAkMoTH2yJPQDvXD67SCgHuf0OuPI9gdXggyxMPu7gn9VRpR+psmHk0YZXBNGH0s8G LqfI3cIwWWkDGkT54qj74151WhDFCNb8RWWYZJX20e3TCYRVGbHx7ajzL/prJpyozjJM P9dg== X-Gm-Message-State: AC+VfDysIhPl6lbEJ2WkFK5JRiQxBu0pVs4FrhJkd2+eeUOz1XL9aTDf 7PH3ogFHIbWQccxkyD2ON8M= X-Google-Smtp-Source: ACHHUZ4dAiHZdXniLxJTkgUTGxFZTA34BkWqXauEnC4CDgR/tTjfboJFNTivZhmLJ2Adyf7+kXoPbA== X-Received: by 2002:a17:906:d550:b0:974:20bd:6e15 with SMTP id cr16-20020a170906d55000b0097420bd6e15mr413482ejc.4.1686241854107; Thu, 08 Jun 2023 09:30:54 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id l6-20020a1709065a8600b0097866bc5119sm24920ejq.200.2023.06.08.09.30.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jun 2023 09:30:53 -0700 (PDT) Message-ID: <9f606cfd-6823-3232-4f96-d0bd70b17211@gmail.com> Date: Thu, 8 Jun 2023 18:30:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Johan Jonker Subject: [PATCH v1 4/5] mtd: nand: raw: rockchip-nand-controller: fix oobfree offset and description To: miquel.raynal@bootlin.com Cc: richard@nod.at, vigneshr@ti.com, heiko@sntech.de, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, yifeng.zhao@rock-chips.com References: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> Content-Language: en-US In-Reply-To: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230608_093056_550225_5D3328AD X-CRM114-Status: GOOD ( 15.18 ) 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 The MTD framework reserves 1 or 2 bytes for the bad block marker depending on the bus size. The rockchip-nand-controller driver currently only supports a 8 bit bus, but reserves standard 2 bytes for the BBM. The first free OOB byte is therefore OOB2 at offset 2. Page address(PA) bytes are moved to the last 4 positions before ECC. Update the description for Linux. Signed-off-by: Johan Jonker --- drivers/mtd/nand/raw/rockchip-nand-controller.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 2.30.2 diff --git a/drivers/mtd/nand/raw/rockchip-nand-controller.c b/drivers/mtd/nand/raw/rockchip-nand-controller.c index e39431cfa..cf0fe502f 100644 --- a/drivers/mtd/nand/raw/rockchip-nand-controller.c +++ b/drivers/mtd/nand/raw/rockchip-nand-controller.c @@ -568,9 +568,10 @@ static int rk_nfc_write_page_raw(struct nand_chip *chip, const u8 *buf, * BBM OOB1 OOB2 OOB3 |......| PA0 PA1 PA2 PA3 * * The rk_nfc_ooblayout_free() function already has reserved - * these 4 bytes with: + * these 4 bytes together with 2 bytes for BBM + * by reducing it's length: * - * oob_region->offset = NFC_SYS_DATA_SIZE + 2; + * oob_region->length = rknand->metadata_size - NFC_SYS_DATA_SIZE - 2; */ if (!i) memcpy(rk_nfc_oob_ptr(chip, i), @@ -947,12 +948,8 @@ static int rk_nfc_ooblayout_free(struct mtd_info *mtd, int section, if (section) return -ERANGE; - /* - * The beginning of the OOB area stores the reserved data for the NFC, - * the size of the reserved data is NFC_SYS_DATA_SIZE bytes. - */ oob_region->length = rknand->metadata_size - NFC_SYS_DATA_SIZE - 2; - oob_region->offset = NFC_SYS_DATA_SIZE + 2; + oob_region->offset = 2; return 0; } From patchwork Thu Jun 8 16:31:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 13272562 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 B5376C7EE29 for ; Thu, 8 Jun 2023 16:31:33 +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:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yOEdJCBivs6WOL7X5qvrVvkBtOGzBCiEhInywhioxtI=; b=YV6S10Rp3RWPcZ +IXRHdKXMLoDLp/cWQYU1ygzVH0WAt/3DgbZG4nXUbTb2cWDN/bfh5zYLIL/MterzMOAXy7KvwaFb 263ptOBSoVMcIUtLGxtniFbDjBHZTCpuRsC+7MbOFMEvVUkVyC3Q8F7ZDQg9HXmSMUYGZeXOhFEAZ qy0na+Q7F7bGuBNzXCGARZBtmi7vVKZ/k8gJnHCpve69runETpM9LTnCCl9sFuuhWrQkiynGUPp8H lXh10vsU2ma2DhaVYRqiSpzh+Sic42tTsxG+SsosHXAIwPnnKh20I8UHY+xL795vPPoiXB8TC+c5t mQUmv3hnYpnylq3PNL+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7IXY-009tRQ-0R; Thu, 08 Jun 2023 16:31:12 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7IXT-009tMW-2C; Thu, 08 Jun 2023 16:31:08 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9788faaca2dso144111966b.0; Thu, 08 Jun 2023 09:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686241865; x=1688833865; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=FuC7NSHnCjOPABSYc7BMbW74QWv84w5gPSWpqKs1P3g=; b=aNNyAbTqj3IEtixMqMg+vLI37ql4/0Acm5DTZwIVLAsTl75k6dQ1SmDigYhQyWMe+4 kv8STcPKEhQ/eKeljkyP5gMJqrpUNcA1ZV22qv/pKVdWNepsQP0b4YIgOCJ9/nFEI3v3 yJp2X3xDiG/Qfh/9y30lpl8xi0SV8LzrKgtKS8FZbDPZkDRQ7kfpqqm1TtgYXHIyPOij 45TSLPZ2nYlpojs18oErPwQg/iP8zPc+jII1NcC1iZO4zVuPpFkRc+zitkkk8VBg7uvQ 7p50g0b7aH0eyKMck+wRxrTxMci9kY47b1U73PqqP6BxdHnib0UIX/J1YcboiFYYj6Pg Apsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686241865; x=1688833865; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FuC7NSHnCjOPABSYc7BMbW74QWv84w5gPSWpqKs1P3g=; b=kJuWIa8sokSiaQAjTdppkIyYYPA88IEFeS2I7SIZ8g2DJpqvsPCXWeZ7OsXqVioXRI wIw7V9ILidx+ZyJQhNIPi7MWW5gymsRc7FOCDkjeAzrrY+unN8t6z3XQ90HeGFRO1TgR yA+VQ01GQhpMekav8gcTKAX+iVCLON2OyXnoiVKi7DUj4uHV5SmwjkPboxUlebLsMlb4 8RQmbZZa0U/aSSMtccJXOdU6U/U1pWFJB2MbIpMK2u9lFIqnB1to0DUz+cwe/Uh9IoVx DwLNyj25k8zLwR7Wb6K10PPQIABbt15l87D4z10eLZ4qctjLgo/IEhqG0h98r4xk9qsI nnlw== X-Gm-Message-State: AC+VfDwx4563km735J5YN/a9KkFlzIQ69iVI6sGA8QKpu0hV/+Xg776g vtTNRRamSVMbQ6xO03mqfxU= X-Google-Smtp-Source: ACHHUZ7DyU8f3R8jgsuvsuJAD1m2ESx11xvhon/3qlB8Ls1/utZvujvvZ18ia9yuMt56eXMMwEU18g== X-Received: by 2002:a17:907:9445:b0:974:5c2f:65cc with SMTP id dl5-20020a170907944500b009745c2f65ccmr209318ejc.67.1686241865494; Thu, 08 Jun 2023 09:31:05 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id k19-20020a170906129300b0097381fe7aaasm29029ejb.180.2023.06.08.09.31.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jun 2023 09:31:05 -0700 (PDT) Message-ID: Date: Thu, 8 Jun 2023 18:31:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: Johan Jonker Subject: [PATCH v1 5/5] mtd: nand: add support for the Sandisk SDTNQGAMA chip To: miquel.raynal@bootlin.com Cc: richard@nod.at, vigneshr@ti.com, heiko@sntech.de, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, yifeng.zhao@rock-chips.com References: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> Content-Language: en-US In-Reply-To: <19bf714a-43f9-c30a-8197-91aaaf4a6e5d@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230608_093107_718256_89826243 X-CRM114-Status: UNSURE ( 8.76 ) X-CRM114-Notice: Please train this message. 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 Sandisk SDTNQGAMA is a 8GB size, 3.3V 8 bit chip with 16KB page size, 1KB write size and 40 bit ecc support Signed-off-by: Paweł Jarosz Signed-off-by: Johan Jonker --- drivers/mtd/nand/raw/nand_ids.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.30.2 diff --git a/drivers/mtd/nand/raw/nand_ids.c b/drivers/mtd/nand/raw/nand_ids.c index dacc5529b..53c4118de 100644 --- a/drivers/mtd/nand/raw/nand_ids.c +++ b/drivers/mtd/nand/raw/nand_ids.c @@ -44,6 +44,9 @@ struct nand_flash_dev nand_flash_ids[] = { {"TC58NVG6D2 64G 3.3V 8-bit", { .id = {0x98, 0xde, 0x94, 0x82, 0x76, 0x56, 0x04, 0x20} }, SZ_8K, SZ_8K, SZ_2M, 0, 8, 640, NAND_ECC_INFO(40, SZ_1K) }, + {"SDTNQGAMA 64G 3.3V 8-bit", + { .id = {0x45, 0xde, 0x94, 0x93, 0x76, 0x57} }, + SZ_16K, SZ_8K, SZ_4M, 0, 6, 1280, NAND_ECC_INFO(40, SZ_1K) }, {"SDTNRGAMA 64G 3.3V 8-bit", { .id = {0x45, 0xde, 0x94, 0x93, 0x76, 0x50} }, SZ_16K, SZ_8K, SZ_4M, 0, 6, 1280, NAND_ECC_INFO(40, SZ_1K) },