Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp347737rbb; Sat, 24 Feb 2024 03:18:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUANxyTwhOtf/uK66pk5TQ1C5APfNG1HePdNue4NgTGVtPKdnt/UuovAo1krGWdzfuJjU8BCSrF3xoK5Ai9TGhZmxXHe4ftGi5G2elyXg== X-Google-Smtp-Source: AGHT+IF9Sn6teraMlo6cgSEMT+nWB6ixfhzp5bCEy/ISbiPhtWxjpkcHbENaeMguumUOn202PS4v X-Received: by 2002:ac2:5230:0:b0:512:e1eb:e65e with SMTP id i16-20020ac25230000000b00512e1ebe65emr1375616lfl.14.1708773529680; Sat, 24 Feb 2024 03:18:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708773529; cv=pass; d=google.com; s=arc-20160816; b=t/90hUuKDDqRaRS07l5HWHAADsEm7D7WGp63r+2m6qqh1bdrFoljHbReH/BtfN+1tQ uSa5WVfZ/VK5CEzFmg2MlMR0AtWbb+sClcJ5DNsrpDkACKEZw2jjGaI/FoLqguNSgXfy uXQsx2idKdb+gvj8e9pr6ipecoZ1w0udXKk2DQ29fA3w0R3Yr9+D+53LUv2ftbi495Yr DsyKH2+kJPc6525kRb4zb7KaNp0anYy4qASptS0UkHX5wDcb4S39CeGCCCpGV3DbhksT +Mm2NG2QPepIZLexHtZzoql1WJ68F6oVj04QwkSGHgLyChb9j1KmJA03l5PljcIn18ye sXVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:subject:cc:to:from :date:message-id:dkim-signature; bh=/zHtnHJBkLHaWWffv0wRxWGPw57+ZGOg6K9nRmYxTo4=; fh=ovOr5u126ekykPBOKPUdOVj8ILTCFgtm0zwKK5iarXA=; b=ev8GXddXoRcIaW9pDkiUeEIb0aW7D/bhPOq9WULhJk8ntBs0r3idQMfgvuWdnQEYV0 A5C3vGiTAWJ9HlWEkrktTp5Dg8gIKstgArGGmh9KtlZsi36+dkbStlORZwaecM4RC6nj C29WrvQcY7yTXKdFbRSR/8SSSzpuLGVxY+UuExJ5HjAThiEfAME1IGlSbKzXKSPQgSBY mNNYPtVkgcNLqLdkRt0lB8hKxz8WCdQRUg177281dt6hlsPxtpQfcS7xv2OH/NnQSH22 fEt1p6AV3e7kouBoEpmZRk6yIwHAQl6wXsxP+4Ir7wg7Rdzj+V6f88irNwD6jI9zEzte mKGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="OHn/dHs0"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-79583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z17-20020aa7c651000000b005654d6a248asi432063edr.85.2024.02.24.03.18.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:18:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="OHn/dHs0"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-79583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4BF4B1F2279D for ; Sat, 24 Feb 2024 11:18:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FB4E2511F; Sat, 24 Feb 2024 11:18:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OHn/dHs0" Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 8FB5D10A24 for ; Sat, 24 Feb 2024 11:18:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708773523; cv=none; b=MVSGCKboCPzftPuuBvGEj/bZz9euNKWMpIv32Ae4i0Qcq3Te3tWVQ9zUwgOJfc1b+o0tuQ1zV+VNF1TQPlbKku+RgT22rLaywqizGvpRls6ySiM9DfcxegKez2les1su3He/MojSzrn68cc0IbH5QV+5G6wNWnwxfiLvRF1lVxQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708773523; c=relaxed/simple; bh=K/4cGTKKaechsK64Xd1gIN7fPS7yWIdNXevAsxCLHNE=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R7i4RZzd3tySrFHb+AmDr6KRuoj5oCRrnPckORkcWvjuDRCG3SUxnM/rXY2OaVlx5YU60EsrwqsYJ+sVJZnn5sBSmX1Wz7Vz3MCCaaTWB2fcRyCw77cRuzxAb/h6Q64Miaw1zaTWMkSWJncVmquqsDABfYNz6OGf1jv64pNn9Ls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OHn/dHs0; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-33d61e39912so941141f8f.3 for ; Sat, 24 Feb 2024 03:18:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708773520; x=1709378320; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=/zHtnHJBkLHaWWffv0wRxWGPw57+ZGOg6K9nRmYxTo4=; b=OHn/dHs0xokbWM1GJmnTUign/S2OCdCRvMYuyfFOP+NZicG9lNrrpm9h5Mi0F8ivwA CFdRAYwuh7nd0qpLgkuNqy1hVpFGG8QhXkz4KKoXwz5Yd23KB9FdHjqEToah0syjwd/J xj45zgjUgpcmJPPRXfJ5Q6EC5OtvxejUMgb0xT5t8h4WCJ1mAQMq3wjI0XrduGBZyhaA SIsQfJIsBAsJ1kj3pxvJyEx8XoENB1YDrH5VXvVFlEPsHp0qm38mOOf+fBxnAtO+ylDf PAKvjfWAVl8yE6TOnRNvf9Zbt3NOnH9zXJZzAP7hHZ4aAysXN41M7+LelT0uwSdP435Z JpnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708773520; x=1709378320; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/zHtnHJBkLHaWWffv0wRxWGPw57+ZGOg6K9nRmYxTo4=; b=MFM60SmTQak48K1O+CoJ4ylkHc8XogszArO2WOrIYxSiPxu69oVoBK7m/C8oqUYtQ4 VjFkK8steQm7w3WPt0v3k1BnJwEPfs5HlceR6Xuu41fV/NCzSNakN+x6hzqgd0O3tvcD yomenO2fXQnB2FcBoyUsIIEkYWtNPt6UHrYq1Dx4HKt1d+3SQDYy5+Rz7zdLjso/LXVs C2tSNhJOZkBP8JunaJD+ajy/mfuf/zCVhpaOmQxLAeCr7WUw+BeKqR/EnYLUsLGcLvGv hiGBsJ82l1DbKelUa9u9L4aUhpocVLW6uA3IW/rNBZ+fiE99vCmLFJMhBhAHCwWxfaTl dXMw== X-Forwarded-Encrypted: i=1; AJvYcCXvOJBcKjL+wtQ2oZnqhDFTUekjn7aAmWv4Le59OsXypvjkz8ZWukXvztEngeOY6tpcRst7891QCAAPZWHh4N9P+a+KV+noga9Cs0pB X-Gm-Message-State: AOJu0YxpJk3Xou9Wgl3TGrc9bOGVWXhTJ1hX603RapsCR0JM5zU9xQ+A 3QN9K4RDzK2oWfUjprSCHj9o83janxgecpxVFZwCr+9C8VzIHBk9 X-Received: by 2002:adf:ee06:0:b0:33d:746b:f365 with SMTP id y6-20020adfee06000000b0033d746bf365mr1464302wrn.52.1708773519559; Sat, 24 Feb 2024 03:18:39 -0800 (PST) Received: from Ansuel-XPS. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id k3-20020adff5c3000000b0033d8ce120f2sm1783346wrp.95.2024.02.24.03.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 03:18:39 -0800 (PST) Message-ID: <65d9d08f.df0a0220.988bb.3177@mx.google.com> X-Google-Original-Message-ID: Date: Sat, 24 Feb 2024 12:18:36 +0100 From: Christian Marangi To: Tudor Ambarus Cc: Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, David Bauer Subject: Re: [PATCH v2] mtd: spi-nor: Add support for BoHong bh25q128as References: <20240220200325.19089-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Feb 22, 2024 at 09:19:48AM +0000, Tudor Ambarus wrote: > > > On 2/20/24 20:03, Christian Marangi wrote: > > From: David Bauer > > > > Add MTD support for the BoHong bh25q128as SPI NOR chip. > > The chip has 16MB of total capacity, divided into a total of 256 > > sectors, each 64KB sized. The chip also supports 4KB sectors. > > Additionally, it supports dual and quad read modes. > > > > Datasheet is public and can be found at the referenced link. > > > > Functionality was verified on an Tenbay WR1800K / MTK MT7621 board. > > > > Link: https://www.e-interlink.com.tw/userUpload/files/BH25Q128AS_v1_0.pdf > > Signed-off-by: David Bauer > > [ reworked to new flash_info format ] > > Signed-off-by: Christian Marangi > > --- > > Read/write/erase test are done by flashing and installing an OpenWrt > > image on the spi and by using overlayfs on it confirming correct > > read/write. > > > > root@OpenWrt:/tmp/tmp2# cat /sys/bus/spi/devices/spi0.0/spi-nor/partname > > bh25q128as > > root@OpenWrt:/tmp/tmp2# cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id > > 684018 > > root@OpenWrt:/tmp/tmp2# cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer > > bohong > > > > root@OpenWrt:/# xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp > > 53464450000101ff00000109300000ff68000103600000ffffffffffffff > > ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b > > 083b42bbeeffffffffff00ffffff44eb0c200f5210d800ffffffffffffff > > ffffffffffff003600279ef97764fcebffff > > > > Hey, Christian, > > Seems that the flash defines the SFDP tables, thus it's likely you won't > need a flash entry at all, and instead rely on the generic SFDP driver > to parse the flash settings from SFDP and initialize the flash based on > that. > > Have you tried testing the flash without adding a dedicated entry for > it? Just specifying the jedec,spi-nor compatible in dt will do the > trick. As you do now, but without this patch :). > The user just tested this and It seems there is a problem in JEDEC id? [ 0.726451] spi spi0.0: setup: ignoring unsupported mode bits a00 [ 0.732850] spi-nor spi0.0: unrecognized JEDEC id bytes: 68 40 18 68 40 18 [ 0.739725] spi-nor: probe of spi0.0 failed with error -2 -- Ansuel