Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2169617imb; Sun, 3 Mar 2019 20:59:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxmKolsdDshChWIvik1zujGMC/Yvy296Qv9syNJCFt5KzWMegVc6jQfEoUQgYrQlTNxjIDL X-Received: by 2002:a63:b53:: with SMTP id a19mr6396739pgl.115.1551675551362; Sun, 03 Mar 2019 20:59:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551675551; cv=none; d=google.com; s=arc-20160816; b=hNqbc3SmdPcrh4YQqumTNZ+FnXhwmvdpqVRNxBdE3mYFVY8uhyUTX8Te7PKV2/ByWZ b0PSnCw9oo95ER6+TQqONlOe2hvkpTU1p1L68bwYb9uiuDOXmvpKTIJj1nk22Pw+VIng IH1y91NxD6SLLnAeB3kr6CGz0JbS/0FU7W8N0W5sphFrYjRakjafPH2cwqrqQ55q53Fq 91RGpQX8gpN0EoxiYwt9TW4lrgqXvmP0TC+Zb4A5OIVau4inOh7ArfrQ4eviY1B+JvbU /Gde/fGJX9TZqEc2M6dw7U6qy9xi/EEu2NR/Ae7Brr6aASBaVCwr2bGmbN1M/p7YGB3k Cx9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=yH17txf4TFuUdcK72ItCB0yBsvL8+Qt7qnFBv7x66MY=; b=UbgTXhMQoOitO453unqXYl3J1wm8m/5ZM9ej4Q2m38+yCkWADBP3Dcr7FB7dFF2CRn nax5+W5IA9n0eA0DTa0aRC73u+Qwa+NtzY5sTEKaAmA1vM5GWyUucGL5CAZO/Qeuldc9 /Ym1c5wfqOznsZa1zyDoJI4/XDULHha62+DCRvTLD5gheENUhhLX4ByT8WUyux0Zx1PZ A9puKBP70QILXp3GjFYCyjaHDhQrti+qK+NQrOmk5FjqXypDbyWIA0bvFQOX06+BjZK7 3TMiwxIu2HLLiNR8n9yl107kIaiaGeB07X4oEUxcApfBkEdewsdedtiKDO3uoCfsYxRH rRWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si4392817pgn.558.2019.03.03.20.58.42; Sun, 03 Mar 2019 20:59:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726037AbfCDE50 (ORCPT + 99 others); Sun, 3 Mar 2019 23:57:26 -0500 Received: from mail-sz.amlogic.com ([211.162.65.117]:54811 "EHLO mail-sz.amlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbfCDE50 (ORCPT ); Sun, 3 Mar 2019 23:57:26 -0500 Received: from [10.28.18.125] (10.28.18.125) by mail-sz.amlogic.com (10.28.11.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Mon, 4 Mar 2019 12:56:42 +0800 Subject: Re: [RFC PATCH nand-next 0/2] meson-nand: support for older SoCs To: Martin Blumenstingl CC: , , , , , , , References: <20190301182922.8309-1-martin.blumenstingl@googlemail.com> From: Liang Yang Message-ID: <98776767-c4d7-1207-6d42-97105f289bec@amlogic.com> Date: Mon, 4 Mar 2019 12:56:41 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190301182922.8309-1-martin.blumenstingl@googlemail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.28.18.125] X-ClientProxiedBy: mail-sz.amlogic.com (10.28.11.5) To mail-sz.amlogic.com (10.28.11.5) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Martin, On 2019/3/2 2:29, Martin Blumenstingl wrote: > Hi Liang, > > I am trying to add support for older SoCs to the meson-nand driver. > Back when the driver was in development I used an early revision (of > your driver) and did some modifications to make it work on older SoCs. > > Now that the driver is upstream I wanted to give it another try and > make a real patch out of it. Unfortunately it's not working anymore. > > As far as I know the NFC IP block revision on GXL is similar (or even > the same?) as on all older SoCs. As far as I can tell only the clock > setup is different on the older SoCs (which have a dedicated NAND > clock): > - we don't need the "amlogic,mmc-syscon" property on the older SoCs > because we don't need to setup any muxing (common clock framework > will do everything for us) > - "rx" and "tx" clocks don't exist > - I could not find any other differences between Meson8, Meson8b, > Meson8m2, GXBB and GXL > That is right. the serials NFC is almost the same except: 1) The clock control and source that M8-serials are not share with EMMC. 2) The base register address 3) DMA encryption option which we don't care on NFC driver. > In this series I'm sending two patches which add support for the older > SoCs. > > Unfortunately these patches are currently not working for me (hence the > "RFC" prefix). I get a (strange) crash which is triggered by the > kzalloc() in meson_nfc_read_buf() - see below for more details. > > Can you please help me on this one? I'd like to know whether: > - the meson-nand driver works for you on GXL or AXG on linux-next? > (I was running these patches on top of next-20190301 on my M8S > board which uses a 32-bit Meson8m2 SoC. I don't have any board using > a GXL SoC which also has NAND) Yes, it works on AXG platform using a MXIC slc nand flash(MX30LF4G); but i an not sure it runs the same flow with yours. because i see the print "Counld not find a valid ONFI parameter page, ...." in yours. i will try to reproduce it on AXG(i don't have a M8 platform now). > - you see any issue with my patches? (maybe I missed more differences > between GXL and the older SoCs) > i think it is ok now. > > kernel log extract: > [...] > Could not find a valid ONFI parameter page, trying bit-wise majority to recover it > ONFI parameter recovery failed, aborting > Unable to handle kernel paging request at virtual address 80110000 > pgd = (ptrval) > [80110000] *pgd=00000000 > Internal error: Oops: 5 [#1] PREEMPT SMP ARM > Modules linked in: > CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc8-next-20190301-00053-g50ac6f7757e2 #4145 > Hardware name: Amlogic Meson platform > PC is at kmem_cache_alloc_trace+0xc8/0x268 > LR is at kmem_cache_alloc_trace+0x2c/0x268 > pc : [] lr : [] psr: 60000013 > sp : c02adc58 ip : e9e7a440 fp : 00004ee2 > r10: 80110000 r9 : ffffe000 r8 : c110918c > r7 : 00000008 r6 : c08967c0 r5 : 00000dc0 r4 : c0201e40 > r3 : c109dd30 r2 : 00000000 r1 : 00004ee2 r0 : 00000000 > Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none > Control: 10c5387d Table: 0020404a DAC: 00000051 > Process swapper/0 (pid: 1, stack limit = 0x(ptrval)) > Stack: (0xc02adc58 to 0xc02ae000) > dc40: e9d84048 00000003 > dc60: e9e7a440 c02add18 00000028 e9e68680 c02adcf0 00000003 e9d84048 00000002 > dc80: e9e7a440 c08967c0 c1108cb4 c02adcdc 10624dd3 c02adce4 10624dd3 00000005 > dca0: e9e7a440 c0f5c310 00000028 c0f09998 00000005 e9d84048 00000005 c02add57 > dcc0: c1108c88 e9e7a440 c02adcf0 e9d84428 e9d843b0 c0882258 000000ff 40000000 > dce0: c02adce8 00000000 c02adcf0 00000003 00000000 00000090 00000000 00000000 > dd00: 00000000 00000001 00000001 c02adcdf 00000000 00000190 00000002 00000005 > dd20: c02add57 00000001 00000000 a10a1ef7 00000000 c1108c88 c1180250 e9d843c0 > dd40: 00000001 000000de 00000000 c088d114 c0f08db4 00d843c0 00000000 a10a1ef7 > dd60: 00000015 e9d84048 c1108c88 c088d470 e9d84048 c08888b4 00000000 60000013 > dd80: c0eebc9c 000000ad c0da01ac 00000000 e9e7a48c c0cc6d50 c12122cc a10a1ef7 > dda0: e9e7a440 e9e7a440 e9d84040 c0eebc9c e987f410 eafd6748 e9d84048 c1108c88 > ddc0: e9e7a48c c0895c70 00000000 e9871f00 e9e7a440 c04eef60 00000000 eafd64bc > dde0: e9e7a534 00000000 00000000 00000000 00000001 a10a1ef7 00000000 e987f410 > de00: 00000000 c1180728 00000000 00000000 c1180728 00000000 c1071854 c07fd388 > de20: c120da38 e987f410 c120da3c 00000000 00000000 c07fb410 e987f410 c1180728 > de40: c1180728 c07fb910 00000000 c1071834 c10004a8 c07fb65c c10004a8 c0a917b4 > de60: c0da1914 e987f410 00000000 c1180728 c07fb910 00000000 c1071834 c10004a8 > de80: c1071854 c07fb908 00000000 c1180728 e987f410 c07fb968 e98b8eb4 c1108c88 > dea0: c1180728 c07f97d4 c1175260 c029a958 e98b8eb4 a10a1ef7 c029a96c c1180728 > dec0: e9e1fa80 c1175260 00000000 c07fa844 c0f09c64 c1108c88 ffffe000 c1180728 > dee0: c1108c88 ffffe000 c103b788 c07fc494 c11c2ca0 c1108c88 ffffe000 c0302f1c > df00: ebfffd96 c0346f90 c0fab8a0 c0f2ad00 00000000 00000006 00000006 c0e9e26c > df20: 00000000 c1108c88 c0eb11b0 c0e9e2e0 c11d1300 ebfffd84 ebfffd89 a10a1ef7 > df40: c1071838 c11c2ca0 c10914b8 a10a1ef7 c11c2ca0 c1091804 00000007 c11d1300 > df60: c11d1300 c1001180 00000006 00000006 00000000 c10004a8 0000013d 00000000 > df80: c02c0504 00000000 c0cbf6e8 00000000 00000000 00000000 00000000 00000000 > dfa0: 00000000 c0cbf6f0 00000000 c03010e8 00000000 00000000 00000000 00000000 > dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 > [] (kmem_cache_alloc_trace) from [] (meson_nfc_exec_op+0x2c4/0x3e8) > [] (meson_nfc_exec_op) from [] (nand_readid_op+0x128/0x1c4) > [] (nand_readid_op) from [] (hynix_nand_has_valid_jedecid+0x34/0x78) > [] (hynix_nand_has_valid_jedecid) from [] (hynix_nand_decode_id+0x64/0x3fc) > [] (hynix_nand_decode_id) from [] (nand_scan_with_ids+0xa04/0x171c) > [] (nand_scan_with_ids) from [] (meson_nfc_probe+0x460/0x690) > [] (meson_nfc_probe) from [] (platform_drv_probe+0x48/0x98) > [] (platform_drv_probe) from [] (really_probe+0x1e0/0x2cc) > [] (really_probe) from [] (driver_probe_device+0x60/0x16c) > [] (driver_probe_device) from [] (device_driver_attach+0x58/0x60) > [] (device_driver_attach) from [] (__driver_attach+0x58/0xcc) > [] (__driver_attach) from [] (bus_for_each_dev+0x74/0xb4) > [] (bus_for_each_dev) from [] (bus_add_driver+0x1b8/0x1d8) > [] (bus_add_driver) from [] (driver_register+0x74/0x108) > [] (driver_register) from [] (do_one_initcall+0x54/0x284) > [] (do_one_initcall) from [] (kernel_init_freeable+0x2d4/0x36c) > [] (kernel_init_freeable) from [] (kernel_init+0x8/0x110) > [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) > Exception stack(0xc02adfb0 to 0xc02adff8) > dfa0: 00000000 00000000 00000000 00000000 > dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 > Code: e5943000 e5942014 e3130007 1a000038 (e79ae002) > ---[ end trace 28d391ed14b0f021 ]--- > > > Martin Blumenstingl (2): > dt-bindings: nand: meson: add support for more SoCs > mtd: rawnand: meson: support for older SoCs up to Meson8 > > .../bindings/mtd/amlogic,meson-nand.txt | 14 ++++-- > drivers/mtd/nand/raw/meson_nand.c | 46 +++++++++++++------ > 2 files changed, 42 insertions(+), 18 deletions(-) >