mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Tony Huang 黃懷厚" <tony.huang@sunplus.com>
To: Krzysztof Kozlowski <krzk@kernel.org>,
	Tony Huang <tonyhuang.sunplus@gmail.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"derek.kiernan@xilinx.com" <derek.kiernan@xilinx.com>,
	"dragan.cvetic@xilinx.com" <dragan.cvetic@xilinx.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "Wells Lu 呂芳騰" <wells.lu@sunplus.com>
Subject: RE: [PATCH v11 2/2] misc: Add iop driver for Sunplus SP7021
Date: Tue, 15 Mar 2022 08:24:10 +0000	[thread overview]
Message-ID: <0d615380aa85444c81e9b93f4a216232@sphcmbx02.sunplus.com.tw> (raw)
In-Reply-To: <f3c7af9b-85a0-1148-6096-30345f1a1478@kernel.org>

Dear Krzysztof:


> >>>> On 12/03/2022 17:16, Tony Huang wrote:
> >>>>> This driver is load 8051 bin code.
> >>>>> The IOP core is DQ8051, so also named IOP8051.
> >>>>> Need Install DQ8051, The DQ8051 bin file generated by keil C.
> >>>>> We will provide users with 8051 normal and power off source code.
> >>>>> Path:
> >>>>> https://sunplus.atlassian.net/wiki/spaces/doc/pages/610172933/
> >>>>>
> >>>>
> >>
> How+to+use+I+O+processor+8051+of+SP7021#5.-Write-C-or-assembly-source
> >>>> How+to+use+I+O+processor+8051+of+-
> >>>>> files-for-IOP
> >>>>> Users can follow the operation steps to generate normal.bin and
> >>>>> poweroff.bin.
> >>>>> Path:
> >>>>> https://sunplus.atlassian.net/wiki/spaces/doc/pages/466190338
> >>>>> /26.+IOP8051 26.5?How To Create 8051 bin file
> >>>>>
> >>>>> PMC in power management purpose:
> >>>>> Add sp_iop_poweroff() function. pm_power_off=sp_iop_poweroff.
> >>>>> When the power off command is executed.
> >>>>> The 8051 has a register(DEF_PWR_EN_0=0) to control the power-on
> >>>>> and power-off of the system.
> >>>>>
> >>>>> Signed-off-by: Tony Huang <tonyhuang.sunplus@gmail.com>
> >>>>> ---
> >>>>> Changes in v11:
> >>>>>  - Addressed comments from Arnd Bergmann.
> >>>>
> >>>> How did you address Arnd's comments about splitting the driver to
> >>>> proper parts? drivers/clk and drivers/power/reset?
> >>>>
> >>>
> >>> drivers/clk : SP7021 system has clock device driver (clk-sp7021.c).
> >>> So I set the IOP clock through the following function.
> >>> clk_prepare_enable(iop->iopclk);
> >>> clk_disable_unprepare(iop->iopclk);
> >>>
> >>> drivers/power/reset : SP7021 system does not have a power off device
> driver.
> >>
> >> What does it mean? The feedback was to split clk and reset features
> >> to separate drivers and I still see only two patches here with a misc
> >> driver. So how is his comments addressed? You did not reply in that thread.
> >>
> >
> > I finished replying to Arnd.
> >
> >>>
> >>>>>  - Addressed comments from krzysztof.
> >>>>>
> >>>>>  MAINTAINERS                |   1 +
> >>>>>  drivers/misc/Kconfig       |  23 +++
> >>>>>  drivers/misc/Makefile      |   1 +
> >>>>>  drivers/misc/sunplus_iop.c | 411
> >>>>> +++++++++++++++++++++++++++++++++++++++++++++
> >>>>
> >>>> The driver looks like SoC specific driver. Why did you put it in
> >>>> drivers/misc/, not in usual place - drivers/soc/?
> >>>
> >>> 8051 is designed for processing I/O events, like receiving IR signal
> >>> from
> >> remote controller,
> >>> taking care of power on or off requests from RTC, or other hardware
> >>> events
> >> of external peripherals
> >>> even when power of main system is off.
> >>> So I put it in drivers/misc.
> >>
> >> Is IOP8061 a separate device? Your datasheet is saying its embedded
> >> in
> >> SP7021 SoC, so it is a soc driver. This does not fit misc driver
> >> description (a "strange device") but a SoC driver description.
> >>
> >
> > IOP is a separate device. CPU is 8051.
> > SP7021 contains three kinds of CPU.
> > Quad-core ARM Cortex-A7 (CA7)
> > ARM926 real-time core
> > 8051 low-power core
> >
> >>>
> >>>> sp_iop_poweroff is still here.
> >>>
> >>> sp_iop_poweroff(): SP7021 system does not have a power off device driver.
> >>> 				I have to put it here.
> >>
> >> This should be rather in a reset driver, not in a misc one. What is
> >> your plan for this driver? You described the hardware and judging by
> >> it, there will be quite a lot of separate features so it's reasonable
> >> to split the driver into separate logical elements. However keeping
> >> all in the same place would be ok, if you do not plan to add any more
> features.
> >> This would mean the driver will handle *only* reset and FW loading.
> >>
> >
> > Can I put sp_iop_poweroff() here for now?
> > When power off device driver is added in /driver/power/reset is complete,
> we will move to it.
> 
> Not really, because misc drivers is not a place for power off drivers.
> The driver here looks now like responsible only for system power management
> of a SoC, so most likely drivers/soc. However it has even less sense to add
> some feature here and immediately move it somewhere more appropriate
> (instead just add it to the appropriate place).
> 
> Your moving of parts of it to drivers/power/reset is now confusing. What will
> be left here? Please send entire set not just pieces.
> 

I may not fully understand your requirements.				
You: What is your plan for this driver? 				
< ----- reset driver? Misc driver?				
You: However keeping all in the same place would be ok, if you do not plan to add any more features.				
This would mean the driver will handle *only* reset and FW loading.				
< ------ 	 Because system does not have a power off device driver.			
	sp_iop_poweroff() can be placed in iop driver?			


  reply	other threads:[~2022-03-15  8:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-12 16:16 [PATCH v11 0/2] " Tony Huang
2022-03-12 16:16 ` [PATCH v11 1/2] dt-bindings: misc: Add iop yaml file " Tony Huang
2022-03-13  9:33   ` Krzysztof Kozlowski
2022-03-14  1:37     ` Tony Huang 黃懷厚
2022-03-13  9:40   ` Krzysztof Kozlowski
2022-03-14  1:39     ` Tony Huang 黃懷厚
2022-03-14 14:42   ` Rob Herring
2022-03-12 16:16 ` [PATCH v11 2/2] misc: Add iop driver " Tony Huang
2022-03-13  9:43   ` Krzysztof Kozlowski
2022-03-14  6:08     ` Tony Huang 黃懷厚
2022-03-14  7:55       ` Krzysztof Kozlowski
2022-03-15  2:08         ` Tony Huang 黃懷厚
2022-03-15  7:22           ` Krzysztof Kozlowski
2022-03-15  8:24             ` Tony Huang 黃懷厚 [this message]
2022-03-15  9:22               ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d615380aa85444c81e9b93f4a216232@sphcmbx02.sunplus.com.tw \
    --to=tony.huang@sunplus.com \
    --cc=arnd@arndb.de \
    --cc=derek.kiernan@xilinx.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dragan.cvetic@xilinx.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=tonyhuang.sunplus@gmail.com \
    --cc=wells.lu@sunplus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®