From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965954AbcIHKAb (ORCPT ); Thu, 8 Sep 2016 06:00:31 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:62832 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938703AbcIHKAa (ORCPT ); Thu, 8 Sep 2016 06:00:30 -0400 From: Arnd Bergmann To: "zhichang.yuan" Cc: linux-arm-kernel@lists.infradead.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org, lorenzo.pieralisi@arm.com, minyard@acm.org, benh@kernel.crashing.org, gabriele.paoloni@huawei.com, john.garry@huawei.com, liviu.dudau@arm.com, zhichang.yuan02@gmail.com, zourongrong@gmail.com Subject: Re: [PATCH V2 2/4] ARM64 LPC: LPC driver implementation on Hip06 Date: Thu, 08 Sep 2016 12:00:26 +0200 Message-ID: <74367472.RYBpLsaIy1@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <57D11BE9.7010709@hisilicon.com> References: <1473255233-154297-1-git-send-email-yuanzhichang@hisilicon.com> <2175767.JxAh0qjf0L@wuerfel> <57D11BE9.7010709@hisilicon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:uKwkzPvc1w8kN0p+v3XW31B6u9jb+sRuKlxdyNPY56lcWAYRl33 TCzMF5IrVSBKrXdXxRY7nZf14FAL8PMpUftbymy2IGoCzPqqVctSe+6vshR5RsbrfhNDJrF /oB4Y/W/x7f9eZ/3RLJ1KZ2pstKG4Ot6hgz4xCAr7gY2l1SEAXXOgukpOQlij1BGvNBZIO6 eRZ3+3U8L1JhB3vy0bKwQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Yw5u2OfSMsA=:sKnQq26rC8sPDpebTYdNfg RRM/ocMyI3UjGqzjihkNcwbDunnCAsw2S5gsv8Vh8QOYP4/HLIqOQ2qhvhNeRCny0iOFiKnXT ROE5HVAUTW59UGr4hlYOjc+u9SPJ+BftpiAmi3pTcZ29vdwRe1DfwsXkM6weti6t1a+Tv8xHB q9wFkBTWqyd4QDpzFK8HHkzBUVp4U7/Gx9Pmo2DcqGRw0N9iVAHbFu+nNv1aj9MpS8jf8PK96 dAm9OFFezlUiC1ok6UKnFWOfGU35vxHvkMLT5xf0anO82lBFKw+KL+OOfRjuyQh2e/4v4RURL CPAk36a0Cu48Vczp78nPiPPBP/MWp1gCMAh9E82bARS8aK/0pcb9BGxf6v2vAwV5hfVxgMMfI pXoAlX7i/Pcr64pCfF+aNJTJ3w8AcHQ4i0RTWsuQpLIZMYNQxrf0Q+wuIY2i/KVMPQ3q2FXLF 95EKnVpSmUBiE1ezD8YCTWVq4SFKvwwSQaWNs192BAy8R2Gb2POCNXK3IBjEd9W+kK6HtXU3V zKoe/8eSFx3ymzYsTXEaLGQymA+PGUhlxHrY/mv/KCJi29bJc6/gahywHw3/4qOOpFYmDCdFb lCGqYN4meElzjayfP2aaDsjHZBfboY0TEBSZMBH5iA7MLotZcy43afs7/rdxhLwF8A+cMydfJ ColxTnRxLhTp2UcNZoGgiEPIAtbxJoW4uH1tdh6JcgY25XaD7ui6610V05Rv9JkVSwlS/GkC2 77/puixP/TpaVOni Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, September 8, 2016 4:06:01 PM CEST zhichang.yuan wrote: > > > >> +struct lpc_io_ops { > >> + unsigned int periosz; > >> + int (*lpc_iord)(struct hisilpc_dev *pdev, struct lpc_cycle_para *para, > >> + unsigned long ptaddr, unsigned char *buf, > >> + unsigned long dlen); > >> + int (*lpc_iowr)(struct hisilpc_dev *pdev, struct lpc_cycle_para *para, > >> + unsigned long ptaddr, > >> + const unsigned char *buf, > >> + unsigned long dlen); > >> +}; > > > > The operations are not needed unless we also put the earlycon support > > in, so maybe leave them out from the first patch and only add them > > later (or drop the earlycon support if possible). > > Do you want to remove the struct lpc_io_ops member from struct hisilpc_dev?? > I think we can not do that. > > These two functions are essential rd/wr operation for Hip06 LPC. They will be fallen into > when the upper layer drivers call their own IO in/out functions, such as serial_in/serial_out > for 8250 serial. > > I can define lpc_iord/lpc_iowr directly in struct hisilpc_dev and cancel the definition of > struct lpc_io_ops. In my original idea, several LPC cycle types will be supported. Each cycle > type has its specific ops. Now, only one cycle type is needed, the struct lpc_io_ops is not > meaningful. My point was that the indirect function calls are not needed at until patch four, so you can call the functions directly here, and make the logic for indirect function calls part of that later patch. What are the other LPC cycle types that could be supported? Arnd