From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF92EC43334 for ; Tue, 5 Jul 2022 14:17:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 68FBE844E1; Tue, 5 Jul 2022 16:17:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3531284507; Tue, 5 Jul 2022 16:17:18 +0200 (CEST) Received: from mx1.tinet.cat (mx1.tinet.org [195.77.216.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DF6FE84307 for ; Tue, 5 Jul 2022 16:17:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xdrudis@tinet.cat X-ASG-Debug-ID: 1657030634-163e7b70c832ede0001-4l7tJC Received: from smtp01.tinet.cat (smtp01.tinet.org [195.77.216.131]) by mx1.tinet.cat with ESMTP id QAyDqerT5jCUwhmM; Tue, 05 Jul 2022 16:17:14 +0200 (CEST) X-Barracuda-Envelope-From: xdrudis@tinet.cat X-Barracuda-Effective-Source-IP: smtp01.tinet.org[195.77.216.131] X-Barracuda-Apparent-Source-IP: 195.77.216.131 Received: from begut (99.red-79-152-185.dynamicip.rima-tde.net [79.152.185.99]) by smtp01.tinet.cat (Postfix) with ESMTPSA id 16BD5605E0C1; Tue, 5 Jul 2022 16:17:14 +0200 (CEST) Date: Tue, 5 Jul 2022 16:17:12 +0200 From: Xavier Drudis Ferran To: Johan Jonker Cc: Kever Yang , Simon Glass , Philipp Tomsich , xypron.glpk@gmx.de, U-Boot-Denx , Yifeng Zhao , jon.lin@rock-chips.com, "open list:ARM/Rockchip SoC support" , miquel.raynal@bootlin.com, michael@amarulasolutions.com, dario.binacchi@amarulasolutions.com Subject: Re: [PATCH v1 1/6] rockchip: block: add Rockchip IDB block device Message-ID: <20220705141712.GB2037@begut> X-ASG-Orig-Subj: Re: [PATCH v1 1/6] rockchip: block: add Rockchip IDB block device References: <20220701094304.1846-1-jbx6244@yandex.com> <1816d342-1bd1-ff1e-efe6-af4595850946@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1816d342-1bd1-ff1e-efe6-af4595850946@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Barracuda-Connect: smtp01.tinet.org[195.77.216.131] X-Barracuda-Start-Time: 1657030634 X-Barracuda-URL: https://webmail.tinet.cat:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 3188 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: SPAM GLOBAL 0.9025 1.0000 3.2524 X-Barracuda-Spam-Score: 3.25 X-Barracuda-Spam-Status: No, SCORE=3.25 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=6.0 KILL_LEVEL=8.0 tests=MAILTO_TO_SPAM_ADDR X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.99173 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MAILTO_TO_SPAM_ADDR Includes a link to a likely spammer email X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Thanks for your work. El Tue, Jul 05, 2022 at 03:04:15PM +0200, Johan Jonker deia: > From: Johan Jonker > > The Rockchip SoCs with a NAND as boot device need > a special Rockchip IDB block device to transfer the data > from the rockusb gadget to the NAND driver. > Sorry for the fast browsing, lack of experience and possibly wrong and noisy comment (I'm no U-Boot expert), but if you have patience for my curiosity... This isn't a review, I haven't read it all, just some small parts. > diff --git a/arch/arm/mach-rockchip/rockchip_idb.c b/arch/arm/mach-rockchip/rockchip_idb.c > new file mode 100644 > index 00000000..6243131d > --- /dev/null > +++ b/arch/arm/mach-rockchip/rockchip_idb.c [...] > +struct NandParaInfo { > + u8 id_bytes; > + u8 nand_id[6]; > + u8 vendor; > + u8 die_per_chip; > + u8 sec_per_page; > + u16 page_per_blk; > + u8 cell; > + u8 plane_per_die; > + u16 blk_per_plane; > + u16 operation_opt; > + u8 lsb_mode; > + u8 read_retry_mode; > + u8 ecc_bits; > + u8 access_freq; > + u8 opt_mode; > + u8 die_gap; > + u8 bad_block_mode; > + u8 multi_plane_mode; > + u8 slc_mode; > + u8 reserved[5]; > +}; > + Is part of this info already represented in nand_flash_dev in include/linux/mtd/rawnand.h ? And is it worth merging somehow ? Or should this be synced to something external and the .h file I mentioned be synced to linux, so merging would be more trouble than it is worth ? > + > +u16 random_seed[] = { > + 0x576a, 0x05e8, 0x629d, 0x45a3, > + 0x649c, 0x4bf0, 0x2342, 0x272e, > + 0x7358, 0x4ff3, 0x73ec, 0x5f70, [...] > + 0x3b2e, 0x7ec7, 0x4fd2, 0x5d28, > + 0x751f, 0x3ef8, 0x39b1, 0x4e49, > + 0x746b, 0x6ef6, 0x44be, 0x6db7, > +}; Where does this come from ? Is it copyrightable ? If so, is it licensed ? fair use ? Does it need to be synced every so often with some external source ? > + > +struct NandParaInfo NandFlashParaTbl[] = { > + {6, {0x2c, 0x64, 0x44, 0x4b, 0xa9, 0x00}, 4, 1, 16, 256, 2, 2, 2048, 0x01df, 3, 17, 40, 32, 1, 0, 1, 0, 0, {0, 0, 0, 0, 0}}, > + {6, {0x2c, 0x44, 0x44, 0x4b, 0xa9, 0x00}, 4, 1, 16, 256, 2, 2, 1064, 0x01df, 3, 17, 40, 32, 1, 0, 1, 0, 0, {0, 0, 0, 0, 0}}, > + {6, {0x2c, 0x68, 0x04, 0x4a, 0xa9, 0x00}, 4, 1, 8, 256, 2, 2, 2048, 0x011f, 1, 0, 24, 32, 1, 0, 1, 0, 0, {0, 0, 0, 0, 0}}, [...] > + {6, {0x98, 0xde, 0x94, 0x82, 0x76, 0x56}, 1, 1, 16, 256, 2, 2, 2062, 0x05d1, 1, 33, 40, 32, 2, 1, 1, 0, 0, {0, 0, 0, 0, 0}}, [...] > + {6, {0xec, 0xd5, 0x94, 0x76, 0x54, 0x43}, 0, 1, 16, 128, 2, 2, 1038, 0x0119, 2, 0, 24, 36, 3, 1, 3, 0, 0, {0, 0, 0, 0, 0}}, > + {6, {0xec, 0xd7, 0x14, 0x76, 0x54, 0xc2}, 0, 1, 16, 128, 2, 2, 2076, 0x0491, 2, 0, 24, 40, 3, 1, 3, 0, 0, {0, 0, 0, 0, 0}}, > + {6, {0xec, 0xde, 0x94, 0xc3, 0xa4, 0xca}, 0, 1, 32, 792, 2, 1, 688, 0x04c1, 11, 50, 40, 32, 3, 1, 1, 0, 1, {0, 0, 0, 0, 0}}, > +}; > + Is this info partially duplicated in drivers/mtd/nand/raw/nand_ids.c ? Should it be merged and this added there somehow ? It seems to have more data, but I don't know if some items are deductible from others. Could some constants be used to make it easier to read ?