From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH v7 3/3] [POWERPC] MPC832x_RDB: update dts to use SPI1in QE, register mmc_spi stub
Date: Tue, 4 Sep 2007 14:47:50 +0400 [thread overview]
Message-ID: <20070904104750.GA32451@localhost.localdomain> (raw)
In-Reply-To: <fdaf530168b099fcb5a3fbbe45e38271@kernel.crashing.org>
On Tue, Sep 04, 2007 at 01:17:51AM +0200, Segher Boessenkool wrote:
>> I expect very few things from the bootloader: setup memory controller,
>
> Setup CPUs, clocks and voltages, system busses, system controllers,
> memory controllers, memory itself,
Yup-yup, these little things. ;-) But clocks and voltages are set
up by the firmware to initially boot the kernel. After kernel
booted, it can, and should, and do manage this stuff. Power
management (includingturning on/off clocks, voltages), cpu freq
(this leads into whole other management issues, like changing
prescalers for companion chips and/or on-board CPLDs, if they're
getting clocks from the CPU-dependant source).
That's for clocks and voltages. Ok, let's back to GPIOs.
> _and system GPIOs_ :-)
Yup, firmware should set up gpios, to make initial kernel boot.
After that, kernel can and should manage GPIOs. Few examples.
Say units (like USB or SPI) can work in very different modes. And
it's okay if user want to change device mode in the runtime. Often
that means that we must also change GPIOs' dedicated functions or
even directions. Say, SPI slave or master, USB host/device/otg,
and so on.
Yes, probably there is no single powerpc driver actually doing this
today, because of many reasons. Some features unneeded today, some
are hard to implement. And maybe there is no single PowerPC device
yet that needs this, I don't know, but it's easy to imagine. ;-)
Another example, power management - if some unit temporarily unused,
to save power GPIOs should be set up differently. Say if SPI unit
turned off (unused just now), it's wise to bring their dedicated
GPIOs to "power saving" state (be it output0/1 or input, it
depends).
"Unneeded" GPIO pin drains less than 1 mA, but if there are bunch of
such GPIOs, this could be a real issue, especially on battery
powered devices.
And yet another GPIOs use from the kernel side I can bring, and it's
real use case: software-managed chip-selects, just like I have to
use for MMC-over-SPI.
To sum up: kernel anyway must be aware of GPIOs, and I'd prefer
smart kernel wrt GPIOs, instead of dumb kernel blindly relying on
the firmware setup.
At the same time I agree: doing gpio setup in the board file isn't a
great solution, just like doing it in the device tree. But hard-code
gpio setup in the firmware is much worse and short-sighted approach.
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
next prev parent reply other threads:[~2007-09-04 10:45 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-21 13:45 [PATCH v4 0/2] SPI support for fsl_soc and mpc832x_rdb Anton Vorontsov
2007-08-21 13:47 ` [PATCH v4 1/2] [POWERPC] fsl_soc: add support for fsl_spi Anton Vorontsov
2007-08-21 13:47 ` [PATCH v4 2/2] [POWERPC] MPC832x_RDB: update dts to use SPI1 in QE, register mmc_spi stub Anton Vorontsov
2007-08-21 15:27 ` [PATCH v5 0/2] SPI support for fsl_soc and mpc832x_rdb Anton Vorontsov
2007-08-21 15:29 ` [PATCH v5 1/2] [POWERPC] fsl_soc: add support for fsl_spi Anton Vorontsov
2007-08-22 14:24 ` Kumar Gala
2007-08-21 15:29 ` [PATCH v5 2/2] [POWERPC] MPC832x_RDB: update dts to use SPI1 in QE, register mmc_spi stub Anton Vorontsov
2007-08-22 14:25 ` Kumar Gala
2007-08-22 14:22 ` [PATCH v5 0/2] SPI support for fsl_soc and mpc832x_rdb Kumar Gala
2007-08-22 14:54 ` [PATCH v6 " Anton Vorontsov
2007-08-22 14:57 ` [PATCH v6 1/2] [POWERPC] fsl_soc: add support for fsl_spi Anton Vorontsov
2007-08-23 3:24 ` Stephen Rothwell
2007-08-23 11:33 ` [PATCH v7 0/3] " Anton Vorontsov
2007-08-23 11:35 ` [PATCH v7 1/3] [POWERPC] QE lib: extern par_io_config_pin and par_io_data_set funcs Anton Vorontsov
2007-08-23 11:35 ` [PATCH v7 2/3] [POWERPC] fsl_soc: add support for fsl_spi Anton Vorontsov
2007-08-23 11:36 ` [PATCH v7 3/3] [POWERPC] MPC832x_RDB: update dts to use SPI1 in QE, register mmc_spi stub Anton Vorontsov
2007-08-30 21:06 ` Timur Tabi
2007-08-31 13:50 ` [PATCH v7 3/3] [POWERPC] MPC832x_RDB: update dts to use SPI1in " Li Yang-r58472
2007-09-01 23:59 ` Segher Boessenkool
2007-09-03 13:55 ` Timur Tabi
2007-09-03 15:13 ` Anton Vorontsov
2007-09-03 23:17 ` Segher Boessenkool
2007-09-04 10:47 ` Anton Vorontsov [this message]
2007-09-04 18:20 ` Scott Wood
2007-09-04 20:15 ` Vitaly Bordug
2007-09-05 11:40 ` Anton Vorontsov
2007-09-05 13:21 ` Scott Wood
2007-09-07 1:15 ` David Gibson
2007-09-07 1:28 ` Timur Tabi
2007-09-06 14:25 ` Segher Boessenkool
2007-09-06 14:19 ` Segher Boessenkool
2007-09-06 14:35 ` Timur Tabi
2007-09-03 23:12 ` Segher Boessenkool
2007-09-04 3:16 ` Timur Tabi
2007-09-06 14:13 ` Segher Boessenkool
2007-09-06 14:19 ` Scott Wood
2007-09-06 14:29 ` Segher Boessenkool
2007-09-07 3:37 ` David Gibson
2007-08-22 14:57 ` [PATCH v6 2/2] [POWERPC] MPC832x_RDB: update dts to use SPI1 in " Anton Vorontsov
2007-08-22 15:01 ` [PATCH v6 0/2] SPI support for fsl_soc and mpc832x_rdb Kumar Gala
2007-08-22 15:13 ` Anton Vorontsov
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=20070904104750.GA32451@localhost.localdomain \
--to=avorontsov@ru.mvista.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=segher@kernel.crashing.org \
--cc=timur@freescale.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;
as well as URLs for NNTP newsgroup(s).