lkml.org 
[lkml]   [2021]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v4 2/2] misc: Add iop driver for Sunplus SP7021
Date
Dear Arnd:

> > >>
> > >> IOP (IO Processor) embedded inside SP7021 which is used as
> > >> Processor for I/O control, RTC wake-up and cooperation with CPU &
> > >> PMC in power management purpose.
> > >> The IOP core is DQ8051, so also named IOP8051, it supports
> > >> dedicated JTAG debug pins which share with SP7021.
> > >> In standby mode operation, the power spec reach 400uA.
> > >>
> > >> Signed-off-by: Tony Huang <tonyhuang.sunplus@gmail.com>
> > >> ---
> > >> Changes in v4:
> > >> - Addressed comments from Arnd Bergmann.
> >
> > >I don't think you did: I asked you specifically to add code to
> > >interact with the existing in-kernel interfaces to use the
> > >functionality provided by the device. Pick any (at least two)
> > >subsystems and add support, but leave out any custom user space
> > >interfaces (miscdevice, debugfs, sysfs, ...) for the moment.
> >
> >
> >
> > 1. IOP can run sp_iop_platform_driver_shudown() through the poweroff
> > command and the kernel. Perform system power-off actions.
>
> Do you mean that this method a) cleanly shuts down the iop before the system
> is powered down, or b) the driver_shutdown() callback is used to initiate the
> powerdown of the system itself?
>
> In case of a) I would not count that as exposing functionality, what you do here
> is just part of any driver. If instead you are trying to use b), this is the wrong
> way of doing it, see drivers/power/reset/ for examples of how to do it right.
>
> > 2. Wake up the system by relying on the 8051 internal RTC wake-up
> > mechanism and external GPIO input signals to wake up.
>
> I think those should be exposed with drivers/rtc for the RTC and drivers/gpio/
> for the GPIO driver, and then you can use the device tree to configure which
> GPIO to use as a wakeup and how it's connected to the RTC.
>

SP7021:
The system is powered off. But 8051 still has power.
The 8051 has a register to control the power-on and power-off of the system.
8051 has RTC register. When the time is up, 8051 powers on the system.
The 8051 can detect GPIO0~7 pins, and GPIO pin high/low can be used as a power-on judgment mechanism for the system.

> > 3.So you ask me to control IOP(8051) through file_operations, not
> > through DEVICE_ATTR
>
> No, neither of them. Use the appropriate drivers/*/ subsystems for any
> functionality that has an existing subsystem. If there is something that the iop
> does that does not yet have a subsystem, that requires a more thorough design
> discussion for creating a new user interface, ideally in a hardware-independent
> way. You should not start with that until all the normal features (rtc, wakeup,
> suspend, gpio, ...) are supported.
>
> Arnd
\
 
 \ /
  Last update: 2021-12-17 11:25    [W:0.073 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site